Groups | Blog | Home
all groups > dotnet ado.net > december 2003 >

dotnet ado.net : Datasets keep dissappearing from my WinForms


David Hearn
12/31/2003 11:48:17 PM
I am dragging my SQL Server table onto my Windows form to create my
connection and adapter. I then go an generate my dataset and save
everything. When I build, I keep getting compile errors and if I
switch to code view and come back into design view or if I close the
form and re-open it, my dataset is gone. This is driving me nuts. I
can create a new project and drag the same table into it and
everything is fine. What am I missing?

Val Mazur
12/31/2003 11:51:30 PM
Hi David,

Which version of VS.NET are you using? What kind of error do you get? Could
you post exact steps which we could use to reproduce problem?

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp

[quoted text, click to view]

David Hearn
1/1/2004 1:16:48 AM
I am using VS.NET 2003, 1.1 Framework. I drag a table out of my SQL
Database from the Data Explorer onto the form which creates
SQLConnection1 and SQLDataAdapter1. So far, so good. Then, I generate
my dataset and it shows up in the try below the form right beside the
adapter and connection. As soon as I go and look at the form designer
generated code, i can notice that this line:

Friend WithEvents DsEmployee1 As Scheduling.dsEmployee

already has the Scheduling.dsEmployee underlined with the wavy line
telling me that there is something wrong with it. I switch back to
design mode and the dataset is missing.

Here is the error generated during compile:

Type 'Scheduling.dsEmployee' is not defined.

Like I said previously, I can start a new project and perform the same
steps and everything works. This is a project in which I already had
several forms built for but no previous data connections. Thanks for
any help in figuring this one out.



On Wed, 31 Dec 2003 23:51:30 -0500, "Val Mazur" <group51a@hotmail.com>
[quoted text, click to view]
Chuck
1/1/2004 7:10:45 AM
I have also had this problem. If Scheduling is the namespace for your
class, remove it. Then look at the designer. You should have the Dataset
back (at least untill the generated code is re-generated). For some reason
1.1 can't seem to find a dataset within the namespace it is defined in when
the fully qualified name is used. If that is not a bug I don'
[quoted text, click to view]

Chuck
1/1/2004 7:13:30 AM
Sorry about that. I am talking about the expression Scheduling.dsEmployee

Chuck
[quoted text, click to view]

Cor
1/1/2004 11:55:35 AM
Hi David,

I am not using the drag and drop anymore, but when I was using that,
sometimes some ghost code did stay in the desinger build code when I deleted
something.

Maybe you can check that.

Copr

David Hearn
1/1/2004 1:04:07 PM
That did it Chuck. That was the problem. Although it should work with
the namespace so I would like to know why it's not. Also, when I
remove the namespace from one of the lines that is referenceing it, it
keeps trying to add it back. Anyone know why?

Thanks!


On Thu, 01 Jan 2004 07:13:30 GMT, "Chuck" <ceatley@austin.rr.com>
[quoted text, click to view]
Miha Markic
1/1/2004 3:29:58 PM
Hi David,

Try deleting obj and bin folder of project and the open the project.
Does your form (that holds datasets) have some code in parameterless
constructor?

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

[quoted text, click to view]

Chuck
1/1/2004 7:41:16 PM
Ya, you are changing code inside a method reserved for vs. Any changes to
the design view will cause it to regenerate and there goes your 'fix'.

Chuck

[quoted text, click to view]

AddThis Social Bookmark Button