DataConnection Question?

  • Thread starter Thread starter Debbie Carter
  • Start date Start date
D

Debbie Carter

I have searched but can not find the answer to this. When I drag the
OleDbDataAdapter onto a form, I tell it where to find the database. When the
application is then deployed on the user machine won't it try to find the
database using the folder from my development environment? Do I have to be
concerned about this or does VB.NET automatically modify the database path
during the installation process?
 
If you are deploying an application with its own database then you need to
modify the connect string to point to where you are installing it to. Or you
can store the setting for the string outside the code in the app.config file
as a value/key pair.

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
Debbie,

It does not do it automatic and I have myself longtime searched for this
while the answer is very easy.

You can set in the form load event the connection string from the connection
you made with the designer. Do not change anything else, because than you
can get strange behaviour.

Therefore in the load event
OleDbConnection1.connectionstring = "myconnectionstring, whereever you have
placed that"

(assuming OleDbConnection1 is the name you use)

http://www.connectionstrings.com/

http://www.able-consulting.com/ADO_Conn.htm

I hope this helps?

Cor
 
Thank you for your help Terry

Debbie


One Handed Man ( OHM - Terry Burns ) said:
If you are deploying an application with its own database then you need to
modify the connect string to point to where you are installing it to. Or
you can store the setting for the string outside the code in the
app.config file as a value/key pair.

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
Cor...are you saying to modify the connection string line that VB.NET
generates for me when I add the DataAdapter?

Thank you for your help.

Debbie
 
Debbie,

That you should not do, do it in code in the Load event of the form.

Just put there the right connectionstring, which has not to contain all
those things the generated string contains.

Cor

"Debbie Carter"
 
Cor,
Ok will do, thank you very much for the explaination. I will leave the
auto-generated connection string alone and not change it. So when the form
loads, the connection string that I add will over ride or take the place of
the auto-generated one?

Debbie
 
Debbie,

Yes however you do not add it you set a new one by using the =.

Cor
 
Cor,
I understand. Thank you very much for the explanation.

Debbie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top