Typed DataSet connection - required to have one in the .xsd file?

Posted by Kyralessa on Stack Overflow See other posts from Stack Overflow or by Kyralessa
Published on 2008-11-17T18:41:46Z Indexed on 2010/05/25 23:51 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

In the .xsd file for a typed DataSet in .NET, there's a <Connections> section that contains a list of any data connections I've used to set up the DataTables and TableAdapters.

There are times when I'd prefer not to have those there. For instance, sometimes I prefer to pass in a connection string to a custom constructor and use that rather than look for one in settings, .config, etc.

But it seems like if I remove the connection strings from that section (leaving it empty), or remove the section entirely, the DataSet code-generation tool freaks out. Whereas if I don't remove them, the DataSet gripes when I put it in a different project because it can't find the settings for those connection strings.

Is there any way I can tell a typed DataSet not to worry about any connections? (Obviously I'll have to give it a connection if I change any TableAdapter SQL or stored procs, but that should be my problem.)

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET