-
December 6th, 2011, 09:41 AM
#1
DataGrid in WebApp
Does anyone know the issue with this code. I am trying to to display a datagrid from a stored procedure on a button click in the WebApp using C#. I have used this code developing a form and it worked perfect but won't translate to the WebApp . My connections are are set up correctly.
cs is my connection
da is my DataAdapter
ds is my Dataset
MessageBox is declared in a previous class and works correctly.
The stored procedure executes correctly because I have checked my tables in the database that update on the button click. I just want to display the results on my WebApp.
Any suggestions?
protected void Button2_Click1(object sender, EventArgs e)
{
da.SelectCommand = new SqlCommand("execute spTEST", cs);
cs.Open();
da.Fill(ds);
dg.DataSource = ds.Tables[0];
MessageBox("SUCCESS!");
cs.Close();
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|