本文整理汇总了C#中Class1.ExecSQL方法的典型用法代码示例。如果您正苦于以下问题:C# Class1.ExecSQL方法的具体用法?C# Class1.ExecSQL怎么用?C# Class1.ExecSQL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Class1
的用法示例。
在下文中一共展示了Class1.ExecSQL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button1_Click
private void button1_Click(object sender, EventArgs e)
{
Class1 u = new Class1(@"Data Source=C:\Users\Андрей свали с компа\Desktop\myDB.sdf");
string query1 = "drop TABLE Smotrim";
MessageBox.Show(u.ExecSQL(query1));
string query = "CREATE TABLE Smotrim (id INT Identity PRIMARY KEY,vampodhodit nvarchar(20),potipuvolos nvarchar(30), potipulica nvarchar(30));";
u.ExecSQL(query);
string uu= "insert into Smotrim (vampodhodit) SELECT (nazvanietovara) from Haracteristiki where (Kto) =('"+checkedListBox4.Text+"') and (Vozrast) =('"+checkedListBox3.Text+"') and (Tiptovara)=('"+checkedListBox5.Text+"')";
string u1 = "insert into Smotrim (potipuvolos) SELECT (nazvanietovara) from Haracteristiki where (TipVolos) =('"+checkedListBox2.Text+"') and (Tiptovara)=('"+checkedListBox5.Text+"')";
string u2 = "insert into Smotrim (potipulica) SELECT (nazvanietovara) from Haracteristiki where (Tiplica) =('" + checkedListBox1.Text + "') and (Tiptovara)=('" +checkedListBox5.Text +"')";
u.ExecSQL(uu);
u.ExecSQL(u1);
u.ExecSQL(u2);
Vremen v = new Vremen();
v.Show();
}
示例2: button3_Click
private void button3_Click(object sender, EventArgs e)
{
Class1 u = new Class1(@"Data Source=C:\Users\Андрей свали с компа\Desktop\myDB.sdf");
string u8 = "insert into Haracteristiki (nazvanietovara) SELECT all (name) from Tovar";
MessageBox.Show(u.ExecSQL(u8));
}