如何将包含多行的JSON插入到SQL Server数据库中? [英] How can i insert JSON containting multiple rows into my SQL server database?
问题描述
公共函数WorkOrderTask(JSON As WorkOrderTask11)
Public Function WorkOrderTask(JSON As WorkOrderTask11)
昏暗的strConn = WcfService1.My.Settings.dbconn
Dim strSql As String =插入dbo.workorder(wot_id,wot_workorder,wot_machinenumber)values('" ;"','"& JSON .wot_machinenumber
& ''')'
Dim strConn = WcfService1.My.Settings.dbconn
Dim strSql As String = "Insert into dbo.workorder(wot_id,wot_workorder,wot_machinenumber)values('" & JSON .wot_id & "','" & JSON .wot_workorder & "','" & JSON .wot_machinenumber
& "')"
使用oSql作为新数据库.MSSql(strConn)
Using oSql As New Databases.MSSql(strConn)
试试
oSql.OpenSqlServerConnection()
oSql.OpenSqlServerConnection()
oSql.SelectQuery(strSql)
oSql.SelectQuery(strSql)
异常捕获
引发新的System.Exception(ex.Message)
终于
oSql.CloseSqlServerConnection()
结束尝试
Catch ex As Exception
Throw New System.Exception(ex.Message)
Finally
oSql.CloseSqlServerConnection()
End Try
最终使用
结束函数
推荐答案
那你怎么了?
这篇关于如何将包含多行的JSON插入到SQL Server数据库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!