using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
bb_tblAsset table = new bb_tblAsset
{
id = "4",//如果数据库有设置主键,同时标识自增量,则id这句话可以省略。
BaseStation = "101",
SiteX = "101"
};
DataClasses1DataContext ctx = new DataClasses1DataContext();
ctx.bb_tblAsset.InsertOnSubmit(table);
ctx.SubmitChanges();
}
}
或者是
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
bb_tblAsset table = new bb_tblAsset();
table.BaseStation = "10001";
table.SiteX = "1001";
table.remark = "d0d";
DataClasses1DataContext ctx = new DataClasses1DataContext();
ctx.bb_tblAsset.InsertOnSubmit(table);
ctx.SubmitChanges();
}
}
}