Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 where's the dgDetails class?

Author  Topic 

BobLewiston
Starting Member

29 Posts

Posted - 2009-04-04 : 18:33:06
I've tried, but I haven''t been able to find the namespace containing the dgDetails class for the DataGridView control. Can anybody tell me where it is? BTW, this is for C#.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2009-04-05 : 10:27:44
I don't think dgDetails is a class in any of the libraries distributed as part of 3.5. It may be a custom class in another library. The camel case naming makes it seem as though it is a class variable rather than a class name.
Go to Top of Page

BobLewiston
Starting Member

29 Posts

Posted - 2009-04-05 : 13:33:18
sunitabeck:

This is what I'm working on:

From the C# tutorial at Programmer's Heaven (http://www.programmersheaven.com/2/Les_CSharp_13_p9):

private void btnLoadData_Click(object sender, System.EventArgs e)
{
string connectionString = "server=P-III; database=programmersheaven; uid=sa; pwd=;";
SqlConnection conn = new SqlConnection (connectionString);
string cmdString = "SELECT * FROM article";
SqlDataAdapter dataAdapter = new SqlDataAdapter (cmdString, conn);
DataSet ds = new DataSet ();
dataAdapter.Fill (ds, "article");
dgDetails.SetDataBinding (ds, "article");
}

When I try to compile this, I get the following error: "The name 'dgDetails' does not exist in the current context".

I have just been told that dgDetails is a BindingSource. I'm a newbie, so I'm not familiar with BindingSources.

Could you tell me what I need to include in my code to get the compiler to recognize the dgDetails BindingSource and compile my app?
Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2009-04-05 : 14:28:25
dgDetails is most likely the name of the datagrid.

=================================================
Creating tomorrow's legacy systems today. One crisis at a time.
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2009-04-05 : 14:40:23
I looked at the web page; graz is right. The form has a datagrid and you should set its name property to dgDetails. Look for this on that page:

"First of all add a data grid control and a button to your form using the Visual Studio toolbox. We have set the Name property of the data grid to 'dgDetails' and its CaptionText property to 'ProgrammersHeaven Database'. The name of the button is 'btnLoadData'..."
Go to Top of Page
   

- Advertisement -