网站开发需要多少钱,网站留言表格怎么做,目前中国电商平台排名,任县网站建设通过 GBASE南大通用 ADO.NET 接口修改 GBASE南大通用Server 数据需要下面的步骤#xff1a;
1) 使用GBASE南大通用Connection 创建数据库连接对象
2) 使用GBASE南大通用Command 创建命令对象
3) 使用连接对象打开连接
4) 设置命令对象的 CommandText 属性#xff0c;指明…通过 GBASE南大通用 ADO.NET 接口修改 GBASE南大通用Server 数据需要下面的步骤
1) 使用GBASE南大通用Connection 创建数据库连接对象
2) 使用GBASE南大通用Command 创建命令对象
3) 使用连接对象打开连接
4) 设置命令对象的 CommandText 属性指明 SQL 修改语句Insert 或Delete 或 Update并关联连接对象
5) 调用 GBaseCommand 的 ExecuteNonQuery 方法执行 SQL 修改语句
6) 关闭数据库连接
下面的例子将展示如何打开数据库连接向 test 表插入一条数据可以使
用同样的步骤 Delete 或者 Update 数据。
C# 示例
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Data;
using GBase.Data.GBaseClient;
namespace UsingAdoNet
{
class Program
{
static void Main(string[] args)
{
String _ConnStr server192.168.5.41;user
idroot;password1;databasetest;poolingfalse;
using (GBaseConnection _Conn new
GBaseConnection(_ConnStr))
{
try
{
tring _CmdText insert into
test(varchar_column) values(‘varchar_value’) ;
GBaseCommand _Cmd new GBaseCommand(_CmdText,
_Conn);
_Conn.Open();
_Cmd.ExecuteNonQuery();
}
catch (GBaseException ex)
{
Console.WriteLine(ex.StackTrace);
}
finally
{
if( _Conn ! null )
_Conn.Close();
}
}
}
}
}