Database Connection  
Author Message
briggins5





PostPosted: Visual Basic Express Edition, Database Connection Top

Hi,

I am making an application that needs to connect to an sql database, using the database connection wizard, on a remote server. When i type in the path of the database it comes up with a message saying "Attempted to access a path that is not on the disk". How would i connect to this database




Visual Studio Express Editions24  
 
 
ahmedilyas





PostPosted: Visual Basic Express Edition, Database Connection Top

you need to give more details in what you would like to do :-) There are also many examples on these forums so try a search and I'm sure you will find the answer.

Please explain in depth what you want to do to better provide you with a solution



 
 
ahmedilyas





PostPosted: Visual Basic Express Edition, Database Connection Top

what are you typing in the database connection

 
 
Adix





PostPosted: Visual Basic Express Edition, Database Connection Top

So I just want be able to set and get data from selected records. I think it should work with some kind of variable you know if I can set host, user and password.

And sorry 'bout my english hope u get what I mean :P

 
 
briggins5





PostPosted: Visual Basic Express Edition, Database Connection Top

I am putting in the database file name the path of it http://the path of the database/database.mdf. I am leaving the server login fields blank. Please note that i am not using code to do the connection, i am using the database connection wizard. The database is stored on a remote server (I canot change any server settings.)

 
 
ahmedilyas





PostPosted: Visual Basic Express Edition, Database Connection Top

you can get and set data from records returned from a query, thats not a problem. It also depends the approach you are wanting to do. For example you can use a SqlDataReader (for SQL, or OleDbDataReader for OleDB connections such as to MS Access) to read data returned from the query that was executed, and then manually handle the data.

Or you can use a DataAdapter to fill the results returned from a query into a dataset and then bind them to say, a datagridview to show results to the user as well as the ability for them to add, delete and remove existing records and finally updating them to the database.

Check this link out on how to do the above, I hope it is of some use to you

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=753872&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=728535&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=728103&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=634276&SiteID=1

Please feel free to post back if you have any queries at all! :-)