Hi Guys,
I was always working with SQL Server, but now I have a project to work with Microsoft Access. I found out that the similar thing to stored procedure is the queries. I created one
"PARAMETERS prm1 Text ( 255 ), prm2 Text ( 255 );
INSERT INTO tbl ( col1, col2 )
SELECT prm1 AS Expr1, prm2 AS Expr2;"
but I could not pass in the parameters through vb.net... please help, below is my code :
With OledbComm
.Connection = OledbConn
.CommandType = CommandType.StoredProcedure
.CommandText = "sp_Error_Ins"
Try
.Connection.Open()
Catch ex As Exception
End Try
.Parameters.Add("prm1", "data1")
.Parameters.Add("prm2", "data2")
.ExecuteNonQuery()
.Connection.Close()
End With
Thank you very much.
I was always working with SQL Server, but now I have a project to work with Microsoft Access. I found out that the similar thing to stored procedure is the queries. I created one
"PARAMETERS prm1 Text ( 255 ), prm2 Text ( 255 );
INSERT INTO tbl ( col1, col2 )
SELECT prm1 AS Expr1, prm2 AS Expr2;"
but I could not pass in the parameters through vb.net... please help, below is my code :
With OledbComm
.Connection = OledbConn
.CommandType = CommandType.StoredProcedure
.CommandText = "sp_Error_Ins"
Try
.Connection.Open()
Catch ex As Exception
End Try
.Parameters.Add("prm1", "data1")
.Parameters.Add("prm2", "data2")
.ExecuteNonQuery()
.Connection.Close()
End With
Thank you very much.