|
-
Dec 8th, 2007, 03:39 PM
#1
Thread Starter
Member
Sql Server Problem
I'm new to C#,but I used VB.NET a lot ... This prject I have to do in C# and I allready have problems connecting to my SQL SERVER Database.
I put an combobox into my form which I want to link to some records in my database ...
So combobox.Datasource = ... Add Project DataSource ... Database ... Connection to my SQL SERVER Database ...
I saved the connection string as TSConnectionString ... Selected the tables and views I need from my database ...
and Visual Studio has created the files ... TSDataSet.xsd ( TSDataSet.Designer.cs , TSDataSet.xsc , TSDataSet.xss )
I mention that the combobox.DataSource property is still empty and the program can compile succesfully ... for now
When I come back to fill combobox.Datasource with TSDataSet namely tSDataSetBindingSource when i try to compile the
next error message pops up :
Error 1 The type name 'TSDataSet' does not exist in the type 'TSales.TSales'
... and the code behind this error is :
this.tSDataSet = new TSales.TSDataSet(); --------------- here is the error
this.tSDataSetBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.panTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tSDataSet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tSDataSetBindingSource)).BeginInit();
this.SuspendLayout();
Remember though I wrote above that Visual Studio creates those 4 files (TSDataSet.xsd , TSDataSet.Designer.cs , TSDataSet.xsc , TSDataSet.xss ) and puts them in Solution Explorer
So my question is ... how come there is no tSales.TSDataSet ?
and what should I do to link those records to that combobox and other records to other controls in my form
Thank you
PS. I linked the database to a combobox in VB.NET just like I described above and it worked without any problems so it must be a C# problem
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
|