如何将包含多行的JSON插入到SQL Server数据库中? [英] How can i insert JSON containting multiple rows into my SQL server database?

查看:89
本文介绍了如何将包含多行的JSON插入到SQL Server数据库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

公共函数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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆