QUESTION POSED ON: 23 March 2004
Hi. I am trying to save details of a person from a form into the SQL server table. It's giving me the following system error: System.Data.SqlClient.SqlException.
I am using a three-tier architecture and there is a DBAS class that features the following function for executing query:
Public Function ConnectToDB() As SqlConnection
Dim mCon As New SqlClient.SqlConnection(mstrConStr)
mCon.Open()
mintNoOfCon = mintNoOfCon + 1
Return mCon
End Function
Public Function ExecuteQuery(ByVal pstrSQL As String) As Boolean
mCon = ConnectToDB()
mCom.Connection = mCon
mCom.CommandText = pstrSQL
* mCom.ExecuteNonQuery()// showing problem :((
mCon.Close()
End Function
Can you please tell me what to do? I am a VB.NET beginner. Thanks.
|