Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 读回数据库写入时遇到问题_Sql_Vb.net_Openedge_Progress Db - Fatal编程技术网

Sql 读回数据库写入时遇到问题

Sql 读回数据库写入时遇到问题,sql,vb.net,openedge,progress-db,Sql,Vb.net,Openedge,Progress Db,我正在尝试确认我能够写入数据库。我基本上是在说 Insert into locationChangeTable (Col1,Col2,Col3) Values (Val1,Val2,Val3) 然后尝试使用这些值来选择我刚才上下推的记录(没有主键) 有时它会找到我的记录并返回,但大多数情况下,我不会从select中得到任何结果。我提供了代码的摘录 有人知道为什么它找不到我期望的那样吗?或者,您对其他方法有何建议,以确认我的insert语句在vb.net中是否成功这样的内容是否不满足您的要求,而

我正在尝试确认我能够写入数据库。我基本上是在说

Insert into locationChangeTable (Col1,Col2,Col3) Values (Val1,Val2,Val3)
然后尝试使用这些值来选择我刚才上下推的记录(没有主键)

有时它会找到我的记录并返回,但大多数情况下,我不会从select中得到任何结果。我提供了代码的摘录


有人知道为什么它找不到我期望的那样吗?或者,您对其他方法有何建议,以确认我的insert语句在vb.net中是否成功

这样的内容是否不满足您的要求,而不是重新查询数据库:

Dim command1 New SqlCommand("Insert into locationChangeTable (Col1,Col2,Col3) Values ('Val','Val2','Val3')", connection1)

connection1.Open()
returnValue = command1.ExecuteNonQuery()
writer.WriteLine("Rows to be affected by command1: {0}", returnValue)
connection1.Close()
这将返回受命令影响的行数。从……中抽取样本

对于选择

Dim command2 New SqlCommand("Select into locationChangeTable (Col1,Col2,Col3) Values ('Val','Val2','Val3')", connection1)
connection1.Open()
returnValue = command1.ExecuteNonQuery()
connection1.Close()

显示vb代码将插入和选择发送到数据库试图让rep提交同义词请求:-)@JoelCoehoorn我更新了我的Paste链接以包含这些方法Joel。这太疯狂了…太疯狂了,它可能会工作!也许是idk。我得看看
Dim command2 New SqlCommand("Select into locationChangeTable (Col1,Col2,Col3) Values ('Val','Val2','Val3')", connection1)
connection1.Open()
returnValue = command1.ExecuteNonQuery()
connection1.Close()