I have build my project in C#, I add DataSet.xsd
, and connect him to
Oracle DataBase in my computer - work Excellent !!!!
When I installed on the customer computer (that connect to his Oracle DataBase) -
it crushed.
I need to change the connection string on the DataSet.xsd
file - but how to do it ?
Is there any xml file ? Or configuration file ?
Thanks in advance.
You can also open the Dataset and select the TableAdapter that you want to update, right click and go to properties.
here you will see a "connection" property that you can easily change to settings in your web.config file or enter new connection details.
When generating a DataSet with the Wizard you are asked to Create-and-Store a ConnectionString. Take a look in your App.Config
I had similar situation... I'd already created lots of datasets, and they each recorded their own connection string in the code behind. A also manually interacted with database via connectionstring I'd placed in App.config file. So to update all this when deploying to as-yet-unknown server would be pain; yet manually changing all those connectionstrings also put me off. In the end I added a 'test' tableAdapter to the .xsd design page... and created a New connection string - this time specifying it be placed in App.config file. Then by magic... all the tableAdapters now used this one connectionstring - just delete the test object & voila!
You can using like my code: Note that DataSet can change connection string by app.config but you can change connection string by TableAdapter like below:
NCKHSV_TTD54TableAdapters.adtReportGiangVienTableAdapter tableAdapter = new
NCKHSV_TTD54TableAdapters.adtReportGiangVienTableAdapter();//Create a TableAdapter to using.
tableAdapter.Connection.ConnectionString = strConn;//change ConnectionString to strConn
tableAdapter.ClearBeforeFill = true;
tableAdapter.Fill(dataset.adtReportGiangVien);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With