vb.net结合oracle数据库,向表插入参数数据的写法 10
连接sql数据库是这样写的,连接oracle数据库怎么写?DimsqlAsString="InsertIntoLL_Cree_WCAvalues(@rn,@date,@i...
连接sql数据库是这样写的,连接oracle数据库怎么写?
Dim sql As String = "Insert Into LL_Cree_WCA values ( @rn, @date, @item, @ln, @inlo, @qty, @uom, @won, @po,@poln, @mx, 'True' ) "
Using myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString_MXPSS").ConnectionString)
Dim myCommand As New SqlCommand(sql, myConnection)
myCommand.Parameters.Add(New SqlParameter("@rn", GetNewRecordNumber()))
myCommand.Parameters.Add(New SqlParameter("@date", datest))
myCommand.Parameters.Add(New SqlParameter("@item", item))
myCommand.Parameters.Add(New SqlParameter("@ln", ln))
myCommand.Parameters.Add(New SqlParameter("@inlo", Label_v1.Text))
myCommand.Parameters.Add(New SqlParameter("@qty", qty))
myCommand.Parameters.Add(New SqlParameter("@uom", Label_v2.Text))
myCommand.Parameters.Add(New SqlParameter("@won", won))
myCommand.Parameters.Add(New SqlParameter("@po", po))
myCommand.Parameters.Add(New SqlParameter("@poln", Label_v3.Text))
myCommand.Parameters.Add(New SqlParameter("@mx", mx))
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
End Using 展开
Dim sql As String = "Insert Into LL_Cree_WCA values ( @rn, @date, @item, @ln, @inlo, @qty, @uom, @won, @po,@poln, @mx, 'True' ) "
Using myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString_MXPSS").ConnectionString)
Dim myCommand As New SqlCommand(sql, myConnection)
myCommand.Parameters.Add(New SqlParameter("@rn", GetNewRecordNumber()))
myCommand.Parameters.Add(New SqlParameter("@date", datest))
myCommand.Parameters.Add(New SqlParameter("@item", item))
myCommand.Parameters.Add(New SqlParameter("@ln", ln))
myCommand.Parameters.Add(New SqlParameter("@inlo", Label_v1.Text))
myCommand.Parameters.Add(New SqlParameter("@qty", qty))
myCommand.Parameters.Add(New SqlParameter("@uom", Label_v2.Text))
myCommand.Parameters.Add(New SqlParameter("@won", won))
myCommand.Parameters.Add(New SqlParameter("@po", po))
myCommand.Parameters.Add(New SqlParameter("@poln", Label_v3.Text))
myCommand.Parameters.Add(New SqlParameter("@mx", mx))
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
End Using 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询