简体   繁体   English

.net oracle插入查询

[英].net oracle insert query

I have to pass a sql query to oracle database. 我必须将sql查询传递给oracle数据库。

insert into items values('5', 'table', '77', '5-Jan-2017')

now the first column is a integer and last is a date. 现在第一列是整数,最后一列是日期。 Right now I don't have access to database. 现在我无权访问数据库。 Will this query run from .net code will be able to insert code properly. 从.net代码运行此查询将能够正确插入代码。 Please advice. 请指教。

passing numbers should not be in single quotes ''.Moreover you should have smth like jdbc code in your .net to add it to your table like this: 传递的数字不应该用单引号引起来''。此外,您应该在.net中使用类似于jdbc代码的方式将其添加到表中,如下所示:

public static string m_ConnectionString =
    @"Network Library=dbmssocn; Data Source=*server ip*,*port*; database=*db name*; " +
    @"User id=*db username*; Password=*db pass*;";
public static SqlConnection myConnection = new SqlConnection(m_ConnectionString);

if you donot have access it will work though. 如果您没有访问权限,则可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM