override connection in tableadapter (1 Viewer)

joe789

Registered User.
Local time
Today, 22:35
Joined
Mar 22, 2001
Messages
154
Hi Folks,

VB.NET 2010 I used a wizard to create a dataset bound to SQL Server (it created all the necessary components such as the bindingsource, tableadapter, bindingnavigator, and tableadapter manager). I dropped the datagrid on the form and when the code is ran the datagrid is automatically populated with the data successfully and automatically ... all of this is from the wizard.

I am tried to override the connection string that the wizard created. First of all, all the above aforementioned code is hidden because the wizard created it. I looked up how to 'unhide' all the code by going into the properties of the aforementioned items/objects and selecting 'Public' instead of 'Private', but that does not work???

In an effort to do what I need to step by step, the first step is successfully overriding the automatically generated connection string with my own ... but I cannot even view the code the wizard creates. I tried to override the code by placing the following in the form1 load:

mytableadapter.connection.connectionstring = "new connection string"

but that does not work either and doesn't generate any data and doesn't render any errors.

I am at wit's end trying to figure this out and went thru several books and several hours on the net and cannot figure it out.

Perhaps knowing how to create this stuff from scratch may help as opposed to trying to override, or at least view, what the wizard creates automatically?? But even when I tried that, I can never get the datagrid to load the data from the table unless I use the wizard?

Any help would be greatly appreciated!

Thanks
 

Users who are viewing this thread

Top Bottom