|
-
April 25th, 2008, 09:43 AM
#1
Datagridview
Hi,
Working on loading datagridview with the result from a stored procedure.
The following piece of code does not throw any error but the datagridview shows nothing, its empty !!
Any help is appreciated. I am sure someone out there , expert to help.
--------------------------------------------------------------------
OdbcConnection thisConnection = getConnection();
OdbcCommand nonqueryCommand = thisConnection.CreateCommand();
try
{
thisConnection.Open();
nonqueryCommand.CommandText = "selectCategoryCode '83I'"; //selDafcMgrCode '83I'";
DataSet ds = new DataSet();
OdbcDataAdapter da = new OdbcDataAdapter();
da.SelectCommand = new OdbcCommand(nonqueryCommand.CommandText, thisConnection);
DataTable dTable = new DataTable();
da.Fill(dTable);
BindingSource bSource = new BindingSource();
bSource.DataSource = dTable;
d.DataSource = bSource;
thisConnection.Close();
}
catch (OdbcException ex)
{
Console.WriteLine(ex.ToString());
}
------------------------------------------------
Thanks
-dasm
Yes, Possible!!
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
|