Hello
I have created an accounting application using vb.net + Sql server using typed Dataset and Linq2Sql.
Now I want to create a second version for my application using MS-Access
What is the best way to go for that? creating a second copy of my application?
Can I have one form (item list) using Sql Server or Access depending on client choice?
What I have tried:
- I tried to cast sqlserver dataset to access dataset (failed)
- I created one dataset and tried to change the connection string (did not worked)
- I created 2 class for each database, but i could not figure out how to use one variable to handle both class (this below worked, but before each data processing I had to create IF statement to check what to use) Is this right?
Public Class Access_Class
Function GetTable_ITEM As DataTable
End Function
End Class
Public Class SqlServer_Class
Function GetTable_ITEM As DataTable
End Function
End Class
Private Sub frm_itemlist_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If My.Computer.FileSystem.FileExists("myaccess.accdb") Then
Dim o As New Access_Class
Dim dt = o.GetTable_ITEM
Me.DataGridView1.DataSource = dt
Else
Dim o As New SqlServer_Class
Dim dt = o.GetTable_ITEM
Me.DataGridView1.DataSource = dt
End If
End Sub