开发者

need to convert WinForm to WebForm

i have C# Winform program and i need to convert it to Webform.

can i get any simple sample for how to show database grid on screen,

add new, update and delete ?开发者_C百科

i try to show table on screen like this:

SQL = "SELECT * FROM MEN order by Lname";
            dsView = new DataSet();
            adp = new SqlDataAdapter(SQL, Conn);
            adp.Fill(dsView, "MEN");
            adp.Dispose();
            GridView1.DataSource = dsView.Tables["MEN"].DefaultView;

but i dont see nothing


Add:

GridView1.DataBind();

After the DataSource = line

Depending on what you're trying to do you might find that using a datasource control with your GridView makes things easier - can all be done declaratively (although I don't have an example to hand).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜