Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Sql Table doesn't recognized

Status
Not open for further replies.

ahnugroho

Programmer
Jan 29, 2003
45
ID
Hi all,

I have problem with my VB.net code. here is my code :

oSQL = "Insert Into db_PurchDet Values(@pd1,@pd2,@pd3,@pd4,@pd5,@pd6,@pd7,@pd8,@pd9,@pd10)"

oCommand = New SqlClient.SqlCommand(oSQL, oConn)
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd1", SqlDbType.VarChar, 13, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd1").ToString, DataRowVersion.Current, "pd1"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd2", SqlDbType.VarChar, 15, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd2").ToString, DataRowVersion.Current, "pd2"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd3", SqlDbType.VarChar, 50, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd3").ToString, DataRowVersion.Current, "pd3"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd4", SqlDbType.VarChar, 3, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd3").ToString, DataRowVersion.Current, "pd3"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd5", SqlDbType.Int, 4, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd5").ToString, DataRowVersion.Current, "pd5"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd6", SqlDbType.Int, 4, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd6").ToString, DataRowVersion.Current, "pd6"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd7", SqlDbType.Money, 9, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd7").ToString, DataRowVersion.Current, "pd7"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd8", SqlDbType.Money, 9, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd8").ToString, DataRowVersion.Current, "pd8"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd9", SqlDbType.VarChar, 2, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd9").ToString, DataRowVersion.Current, "pd9"))
oCommand.Parameters.Add(New SqlClient.SqlParameter("@pd10", SqlDbType.DateTime, 8, ParameterDirection.Input, False, 0, 0, _
oData.Tables("tblPurchaseDetails").Columns("pd10").ToString, DataRowVersion.Current, "pd10"))

oAdapter.InsertCommand = oCommand
oAdapter.Update(oData, "tblPurchaseDetails")

But, error message "Invalid object Name 'db_PurchDet'" always shown.

Can you help me....??????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top