hi

i have a form in asp.net.
in its cliend side i just write a java script function to add combo boxes in table cell.
then i want to load the combo boxes with data base table items..
i can't do it..pls give me a help for that..
i just paste my code here..


function addRow(){

var table = document.getElementById("tblinv");
var tbody = document.getElementById("tblinv").tBodies[0];
var row = document.createElement("TR");
//Cell 1
var cell1 = document.createElement("TD");
cell1.setAttribute("align","center");

var cell1 =document.createElement("TD");
cell1.setAttribute("align","center");
var sel=document.createElement("select");
cell1.setAttribute("id","cboit" +i);
cell1.setAttribute("runat","server" );
cell1.appendChild(sel);

//Cell 2
var cell2 = document.createElement("TD");
cell2.setAttribute("align","center");
var inp2 = document.createElement("TEXTAREA");
inp2.setAttribute("id","bmk_description" +i);
inp2.setAttribute("cols","20");
inp2.setAttribute("rows","3");
cell2.appendChild(inp2);
//Cell 3
var cell3 = document.createElement("TD");
cell3.setAttribute("align","center");
var inp3 = document.createElement("INPUT");

inp3.setAttribute("rows","2");
inp3.setAttribute("type","text");
inp3.setAttribute("id","bmk_name" + i);
cell3.appendChild(inp3);
//Cell 4
var cell4 = document.createElement("TD");
cell4.setAttribute("align","center");
var inp4 = document.createElement("INPUT");
inp4.setAttribute("type","text");
inp3.setAttribute("rows","2");
inp4.setAttribute("id","bmk_name" + i);
cell4.appendChild(inp4);
//Cell 5

var cell5 =document.createElement("TD");
cell5.setAttribute("align","center");
var sel5=document.createElement('select');
cell5.setAttribute("id","cboit" +i);
cell5.setAttribute("runat","server" );
cell5.appendChild(sel5);
Cell 6
var cell6 = document.createElement("TD");
cell6.setAttribute("align","center");
var inp6 = document.createElement("INPUT");
inp6.setAttribute("type","text");
inp6.setAttribute("id","bmk_link" +i);
cell6.appendChild(inp6);
//
row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell3);
row.appendChild(cell4);
row.appendChild(cell5);
row.appendChild(cell6);
tbody.appendChild(row);
table.appendChild(tbody);
</head>
<body >
<form id="form1" runat="server">

<div>
&nbsp;<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="border:0px #000000; height:100%">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td colspan="2" >&nbsp;
<center >
<div style="margin-top:10px;">
<table width="100%" border="0" cellspacing="3" cellpadding="0">

<tr>
<td align="right" valign="top"><strong>Client</strong> :</td>
<td align="left" valign="top">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
<td align="right" valign="top"><strong>Invoice number</strong> :</td>
<td align="left" valign="top">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>
</tr>

<tr>
<td align="right" valign="top"><strong>Address</strong> :</td>
<td rowspan="2" align="left" valign="top"><label>
&nbsp;<asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine"></asp:TextBox></label></td>
<td align="right" valign="top"><strong>Date</strong> :</td>

<td align="left" valign="top">
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td align="center" valign="top"><a href="#">edit</a></td>
<td align="right" valign="top"><strong>Discount</strong> :</td>
<td align="left" valign="top">
&nbsp;<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox></td>
</tr>

</table>
</div>

<div >
<table id ="tblinv" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<th width="17%" align="center" valign="middle" class="bluebg whitefont" style="height: 19px">Item Name</th>

<th align="center" valign="middle" class="bluebg whitefont" style="height: 19px; width: 19%;">Description</th>
<th width="11%" align="center" valign="middle" class="bluebg whitefont" style="height: 19px">Unit cost</th>
<th align="center" valign="middle" class="bluebg whitefont" style="height: 19px; width: 16%;">Qty</th>
<th align="center" valign="middle" class="bluebg whitefont" style="height: 19px; width: 16%;">Tax</th>
<th width="18%" align="center" valign="middle" class="bluebg whitefont" style="height: 19px">Price</th>
</tr>
</table>

</div> &nbsp;</center>
</td>

</tr>
<tr>
<td colspan="2" align="left" valign="top">
<input type="button" value="Add" onclick="addRow();" id="Button1" />
<input type="button" value="Remove" onclick="removeRowFromTable();" id="Button2" /></td>

</tr>
<tr>
<td height="30" colspan="2" class="skybg">&nbsp;</td>

</tr>
</table>

<br />
<select id="Select2" runat="server" style="width: 168px ">
<option selected="selected"></option>
</select>
<input id="Text1" type="text" value ="" runat ="server" />
</td>
</tr>
</table>

&nbsp;</div>
</form>
</body>
</html>


then i want to load the option values of select control with a datbase table name..

expecting the reply..