How to create authentication window for database when I use dataset – MyDatabaseDataSet?
When I didn’t use dataset I simply open new SqlConnection for every operation and use some connection string which was created after I writed Login and Password. But Dataset use some default connection string. How to change it?
I want to connect to database and tables with connection string Data Source=XXXX-PC\MSSQLSERVER2;Initial Catalog=MyDatabase;User ID={0};Password={1} where {0} and {1} – parameters from authentication window.
I don’t understand where to put my connection string and then use it as default connection string.
I’ve had problems in the past with DataSet objects using a default connection string.
To get around this, I pass the connection string into my SqlConnection constructor.
In my case I’m using a web.config to hold the connection string.