本文整理汇总了C#中DB.ExeSql方法的典型用法代码示例。如果您正苦于以下问题:C# DB.ExeSql方法的具体用法?C# DB.ExeSql怎么用?C# DB.ExeSql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB
的用法示例。
在下文中一共展示了DB.ExeSql方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: store2PlayerDB
//send data directly to DB
private void store2PlayerDB(string str)
{
//DB myDatabase = new DB();
String sql = "";
DateTime dt = DateTime.Now;
DB myDatabase = new DB("Data Source=" + GlobalData.strDatabaseIP + ";Initial Catalog=" + strDatabaseName + ";Integrated Security=no;UID=" + "Xuan" + ";Password=" + "123456");
//("Data Source=UNIVERSI-9CB70F\\SQLEXPRESS" + ";Initial Catalog=" + "Game" + ";Integrated Security=no;UID=" + "Xuan" + ";Password=" + "123456");
string TableName;
TableName = "Player";
//CreateGameTable(TableName);
//if (GlobalData.Current_Round == 0)
//{
// sql = "Truncate" + TableName;
// myDatabase.ExeSql(sql);
//}
sql = "INSERT INTO [" + TableName + "]([ID])VALUES('";
sql = sql + str + "')";
myDatabase.ExeSql(sql);
}
示例2: store2GameDB
private void store2GameDB(string[] strA)
{
//DB myDatabase = new DB();
String sql = "";
DateTime dt = DateTime.Now;
DB myDatabase = new DB("Data Source=" + GlobalData.strDatabaseIP + ";Initial Catalog=" + strDatabaseName + ";Integrated Security=no;UID=" + "Xuan" + ";Password=" + "123456");
//("Data Source=UNIVERSI-9CB70F\\SQLEXPRESS" + ";Initial Catalog=" + "Game" + ";Integrated Security=no;UID=" + "Xuan" + ";Password=" + "123456");
string TableName;
TableName = "Game"+strA[4].ToString()+strA[6].ToString();
//CreateGameTable(TableName);
//if (GlobalData.Current_Round == 0)
//{
// sql = "Truncate" + TableName;
// myDatabase.ExeSql(sql);
//}
sql = "INSERT INTO [" + TableName + "]([ID], [Round#],[Route#],[Scenario#],[Score])VALUES('";
sql = sql + strA[1] + "','" + strA[2] + "','" + strA[3] + "','" + strA[6] + "','" + strA[5] + "')";
myDatabase.ExeSql(sql);
//search DB to get player #
QueryGameDB();
}
示例3: storeResultDB3
private void storeResultDB3(string strSend)
{
string[] strA;
strA = strSend.Split('$');
String sql = "";
DateTime dt = DateTime.Now;
DB myDatabase = new DB("Data Source=" + GlobalData.strDatabaseIP + ";Initial Catalog=" + strDatabaseName + ";Integrated Security=no;UID=" + "Xuan" + ";Password=" + "123456");
//("Data Source=UNIVERSI-9CB70F\\SQLEXPRESS" + ";Initial Catalog=" + "Game" + ";Integrated Security=no;UID=" + "Xuan" + ";Password=" + "123456");
string TableName;
TableName = "Result23";
sql = "INSERT INTO [" + TableName + "]([Player#1], [Player#2], [Player#3],[TT1],[TT2],[TT3],[SP],[Round#],[Scenario#])VALUES('";
sql = sql + strA[1] + "','" + strA[2] + "','" + strA[3] + "','" + strA[4] + "','" + strA[5] + "','" + strA[6] + "','" + strA[7] + "','" + GlobalData.Current_Round.ToString() + "','" + GlobalData.Current_Game.ToString() + "')";
myDatabase.ExeSql(sql);
}
示例4: CreateScoreTable
private void CreateScoreTable(string strName)
{
DB myDatabase1 = new DB("Data Source=" + GlobalData.strDatabaseIP + ";Initial Catalog=" + strDatabaseName + ";Integrated Security=no;UID=" + strDatabaseUser + ";Password=" + strDatabasePwd);
string str_sql = "CREATE TABLE [dbo].[" + strName + "]" +
"([ID] [int] NOT NULL," +
"[Name] [varchar](24) NOT NULL," +
"[Game#] [int] NOT NULL," +
"[Score] [int] NOT NULL,";
myDatabase1.ExeSql(str_sql);
}