A
auntiejack56
Hi, I have been studying the books (2 ADO.NET and 1 VB.NET) and still
can't work out why the records in the database aren't being read.
Dim sConString As String = "Data Source=.
\SQLEXPRESS;AttachDbFilename=""C:\Active Access Library\FigaroNET
\Figaro\Figaro\FigaroData.mdf"";Integrated Security=True;Connect
Timeout=30;User Instance=True"
Dim conDivisions As New SqlConnection(sConString)
conDivisions.Open()
MessageBox.Show(conDivisions.State.ToString())
Dim sCompanySelect As String = "SELECT * FROM
Entities.tbl1_company"
Dim daCompanies As New SqlDataAdapter(sCompanySelect,
conDivisions)
Dim dsCompanies As New DataSet()
Dim intCompanies As Integer
intCompanies = daCompanies.Fill(dsCompanies, "Companies")
MessageBox.Show("Found " & intCompanies & " records.")
dsCompanies.Clear()
conDivisions.Close()
<<<<
I get an "Open" message from the first MessageBox.Show, and 0 from the
second, even though there are some records in Entities.tbl1_company.
Thanks for any help,
Ray
can't work out why the records in the database aren't being read.
Dim sConString As String = "Data Source=.
\SQLEXPRESS;AttachDbFilename=""C:\Active Access Library\FigaroNET
\Figaro\Figaro\FigaroData.mdf"";Integrated Security=True;Connect
Timeout=30;User Instance=True"
Dim conDivisions As New SqlConnection(sConString)
conDivisions.Open()
MessageBox.Show(conDivisions.State.ToString())
Dim sCompanySelect As String = "SELECT * FROM
Entities.tbl1_company"
Dim daCompanies As New SqlDataAdapter(sCompanySelect,
conDivisions)
Dim dsCompanies As New DataSet()
Dim intCompanies As Integer
intCompanies = daCompanies.Fill(dsCompanies, "Companies")
MessageBox.Show("Found " & intCompanies & " records.")
dsCompanies.Clear()
conDivisions.Close()
<<<<
I get an "Open" message from the first MessageBox.Show, and 0 from the
second, even though there are some records in Entities.tbl1_company.
Thanks for any help,
Ray