怎样读取ODBC数据源里呢? OdbcConnection nwindConn = new OdbcConnection("Driver={SQL Server};Server=localhost;" + "Trusted_Connection=yes;Database=northwind");nwindConn.Open(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public void InsertRow(string myConnection) { // If the connection string is null, use a default. if(myConnection == "") { myConnection = "DRIVER={SQL Server};SERVER=MyServer;Trusted_connection=yes;DATABASE=northwind;"; } OdbcConnection myConn = new OdbcConnection(myConnection); string myInsertQuery = "INSERT INTO Customers (CustomerID, CompanyName) Values('NWIND', 'Northwind Traders')"; OdbcCommand myOdbcCommand = new OdbcCommand(myInsertQuery); myOdbcCommand.Connection = myConn; myConn.Open(); myOdbcCommand.ExecuteNonQuery(); myOdbcCommand.Connection.Close();} 关于继承中接口的显示实现 这样的属性“怎样赋值” 异常详细信息: IBatisNet.Common.Exceptions.ConfigurationException: Unable to load embedded resource from as c#日期问题 这样的接口设计对吗 求字符串排序算法 c# 调用mysql.exe 的问题,急!! 如何为datagrid链接列设置多个参数传递给目标页面 folderBrowserDialog1控件使用的问题 关于ascii的问题 CheckBox的问题 软件的价格????
{
// If the connection string is null, use a default.
if(myConnection == "")
{
myConnection = "DRIVER={SQL Server};SERVER=MyServer;Trusted_connection=yes;DATABASE=northwind;";
}
OdbcConnection myConn = new OdbcConnection(myConnection);
string myInsertQuery = "INSERT INTO Customers (CustomerID, CompanyName) Values('NWIND', 'Northwind Traders')";
OdbcCommand myOdbcCommand = new OdbcCommand(myInsertQuery);
myOdbcCommand.Connection = myConn;
myConn.Open();
myOdbcCommand.ExecuteNonQuery();
myOdbcCommand.Connection.Close();
}