hey guys, been reading through the tutorial by mendhak(sp?). Im trying to connect to a sql database.
in the class section of the form i have this code:
Code:
Dim ds As New DataSet()
Dim strSQL As String = "SELECT customer, custid, title, titleid, marketseg, frequency, reason, term, prepress, press, bind, ancillary, paper, prepressbm, pressbm, bindbm, ancillarybm, paperbm, Location FROM assesments"
Dim da As New OleDbDataAdapter(strSQL, conn)
Private conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= C:\Estimating\maindb.mdf"
In the form load i have this code:
And for updating the db i have this code in a button click event:
Code:
Dim dr As DataRow
dr = ds.Tables(0).Rows(1)
dr.BeginEdit()
dr("paperBM") = PaperTotPrice
.
.
.
dr.EndEdit()
da.Update(ds)
ds.AcceptChanges()
The problem im getting is when the form loads(well it actually freezes before it loads) i get an error that says connection string not initialized. What error am i making?