Gold
Gold

Reputation: 62554

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 ?

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

Upvotes: 0

Views: 567

Answers (1)

Murph
Murph

Reputation: 10190

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).

Upvotes: 2

Related Questions