A quesion about udl file and app.config

  • Thread starter Thread starter Jet Leung
  • Start date Start date
J

Jet Leung

Hi all,
I had created a database connection string in a *.udl file by the connection
setting wizard. And I can easily get the udl file path in my program.And I
don't know why when I set the udl file path as the ConnectionString of the
OdbcConnection it throw an error means like this " unhandle
"System.ArgumentException" Exception appear in system.data.dll.
Other message: from the beginning of the index 0,the format of the
initialize string is not accord with specification"

Is the udl file cannot set as the Conncetion of the data base Connectiong?

By the way , can I set the connectiong string into the app.config? Just
like the setting like web.config.
And whe I set the connectiong into app.config can I use
Configuration.AppSettings["myConnection"] to get the connectiong string from
the app.config file?
 
open the udl file using any simple text editor, you will see some plain
text within which you will also see the connection string. Copy this and
paste it in your code (Copy only stuff in quotations). If it works then
you have trouble reading file.
 
Back
Top