emaduddeen
Well-known member
- Joined
- May 5, 2010
- Messages
- 171
- Location
- Lowell, MA & Occasionally Indonesia
- Programming Experience
- Beginner
Hi Everyone,
I wish to set the connection on the fly using the TableAdapter Partial Public Class because it's set up in the DataSet Editor.
Can you tell me what coding to use and how to call the coding? So far I double clicked on the TableAdapter in the editor and it shows this code:
I already placed the 2 dim statements in there. I don't how how to do the rest of the coding and don't know were to call SetTableAdapterConnection() from.
FormMain.strApplicationPathFolderName comes from using this statement:
The purpose of all this is to use the database from the place where the application is installed.
Thanks.
Truly,
Emad
I wish to set the connection on the fly using the TableAdapter Partial Public Class because it's set up in the DataSet Editor.
Can you tell me what coding to use and how to call the coding? So far I double clicked on the TableAdapter in the editor and it shows this code:
VB.NET:
Namespace FormulaDataSetTableAdapters
Partial Public Class FormulasTableAdapter
Public Sub SetTableAdapterConnection()
Dim strDatabasePath = FormMain.strApplicationPathFolderName
' Declare a connection string.
'-----------------------------
Dim strDatabaseConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
strDatabasePath & "\Nutrition.mdb"
End Sub
End Class
End Namespace
I already placed the 2 dim statements in there. I don't how how to do the rest of the coding and don't know were to call SetTableAdapterConnection() from.
FormMain.strApplicationPathFolderName comes from using this statement:
VB.NET:
Public strApplicationPathFolderName As String = System.Windows.Forms.Application.StartupPath
The purpose of all this is to use the database from the place where the application is installed.
Thanks.
Truly,
Emad