Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi I'm using .NET and I can't find the correct syntax for the Data Source parameter of my connection. It is all ok when I write "Dat a Source = C:\Databases\prova.mdb" but what is the correct syntax for a virtual path? If I use "Data Source= prova.mdb" it seems not to work, even the db is in the same folder of the application.

A second question: can I use the SELECT ... INTO instruction to put some values in some application variables?

Sorry I know these are simplest questions but I am totally new ti this ... :)

  • *Experts*
Posted

You can use Environment.CurrentDirectory to get the current directory. Make sure your mdb is in the \bin\Debug folder and not the code folder as well and then using "Data Source=prova.mdb" should be fine

 

SELECT...INTO is SQL only to dynamically create a real or temp table. You'll want a regular SELECT statement and pull the value from the returned DataSet or DataReader.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...