HighTechTalks DotNet Forums  

Problems with DataSet and column names

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss Problems with DataSet and column names in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
bachuspl@op.pl
 
Posts: n/a

Default Problems with DataSet and column names - 12-11-2007 , 07:40 AM






Hi,

I have following problem - I have a table in sql database that
contains column named System
I created dataset in vs2005 application and dragged this table form
server explorer, problem is I get errors in auto generated code
because same name of System namespace and System property:
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public string System {
get {
try {
return ((string)
(this[this.tableID.SystemColumn]));
}
catch (System.InvalidCastException e) {
throw new
System.Data.StrongTypingException("The value for column \'System\' in
table \'ID\' is DBNull.", e);
}
}
set {
this[this.tableID.SystemColumn] = value;
}
}

And all references in code returns error:
System.DBNull.Value
System.Convert.DBNull
System.Data.ConnectionState.Open

Of course manually editing this file, adding using System solves
problem, but I need to do it every time I make slightest change in
dataset, because auto generator is overriding this file after I make
any changes.

And for different reasons I cannot change name of this column neither
in sql nor in dataset. Is there any way to prevent generator to
override this file all the time, or any way to solve the problems with
duplicate names ?

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.