hi to everyone..
i have this code and it doesnt show the datagrid control..
wats wrong with it??
thanks in advance..PHP Code:<%@ Page Language="VB"%>
<%@ import namespace="system.data.sqlclient" %>
<%@ import namespace="system.data" %>
<html>
<head>
</head>
<script runat=server>
sub btnonclick(sender as object,e as eventargs)
dim dt as new datatable("sample")
dt.columns.add(new datacolumn("Name"))
dim dr as datarow = dt.newrow
dr(0)=name.text
dt.rows.add(dr)
mygrid.datasource = dt.defaultview
'mygrid.databind()
end sub
</script>
<body>
<center>
<form runat=server>
<h3> Name: <asp:textbox id="Name" runat="server"/>
</h3>
<asp:button text="btn" onclick="btnonclick" runat="server"/>
<p>
<asp:datagrid id="mygrid" backcolor="#ccccff" headerstyle-backcolor="#aaaadd" runat="server"/>
</form>
</center>
</body>
</html>
i forgot to put this mygrid.databind()
sorry my fault.


Reply With Quote