I develop in Access VBA and am learning VB in Visual Studio. I am trying to create a very simple web page where a user enters some data and it gets stored in a table in SQL Server Express. I can't get the latter part to work.
I'm getting the following error:
Unable to open the physical file "C:\WebSites\IOC\App_Data\
IOC_Data.m
df". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
Unable to open the physical file "C:\WebSites\IOC\App_Data\
IOC_Data_l
og.ldf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
Cannot open database "IOC_Data" requested by the login. The login failed.
Login failed for user 'DELL5150\Al'.
File activation failure. The physical file name "C:\WebSites\IOC\App_Data\
IOC_Data_l
og.ldf" may be incorrect.
From the line below: mySqlDataAdapter.Fill(myDa
taSet, "tblIOC_Data")
'-------------------------
----------
----------
----------
----
' Create a new Connection and SqlDataAdapter
Dim myConnection As Data.SqlClient.SqlConnecti
on
Dim mySqlDataAdapter As Data.SqlClient.SqlDataAdap
ter
myConnection = New Data.SqlClient.SqlConnecti
on("Integr
ated Security=SSPI;Persist Security Info=False;Initial Catalog=IOC_Data;Data Source=DELL5150\SQLEXPRESS
")
mySqlDataAdapter = New Data.SqlClient.SqlDataAdap
ter("Selec
t * from tblIOC_Data", myConnection)
Dim myDataSet As Data.DataSet = New Data.DataSet()
Dim myDataRow As Data.DataRow
Dim myDataRowsCommandBuilder As Data.SqlClient.SqlCommandB
uilder = New Data.SqlClient.SqlCommandB
uilder(myS
qlDataAdap
ter)
mySqlDataAdapter.Fill(myDa
taSet, "tblIOC_Data")
myDataRow = myDataSet.Tables("tblIOC_D
ata").NewR
ow()
myDataRow("IOC_ID") = 1
myDataRow("DateEntered") = txtDate.Text
myDataRow("DiningCenter") = cboDiningCenter.Text
myDataRow("DC_Coordinator"
) = txtDC_Coordinator.Text
myDataSet.Tables("tblIOC_D
ata").Rows
.Add(myDat
aRow)
Any help is greatly appreciated.
Thank you.
Start Free Trial