void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedItem == null) return; string val = comboBox1.SelectedItem.ToString().ToLower(); if (val == "oledb") { button1.Visible = true; button3.Visible = false; } else if (val == "mysql") { button3.Visible = true; button1.Visible = false; core = new MySqlModeCreate(textBox1DbPath.Text); textBox1DbPath.Text = "Server=localhost;Uid=root;Pwd=niejunhua;"; } else if (val == "sqlserver") { button1.Visible = false; textBox1DbPath.Text = "server=192.168.104.117;uid=wftsa;password=jd7nTF#wM;database=K2Sln"; button3.Visible = true; core = new SqlServerModeCreate(textBox1DbPath.Text); } }
static void Main(string[] args) { // TestgeneratePagingSql.d(); // BaseModeCreate create = new MySqlModeCreate("server=localhost;User Id=root;password=niejunhua;Database=nq_article;charset=utf8 "); // create.CreateAll("CommonClass", "nq_article", ""); BaseModeCreate create = new SqlServerModeCreate("server=192.168.104.117;uid=wftsa;password=jd7nTF#wM;database=k2Sln"); create.CreateAll("TestSql", "k2Sln", "", ""); //TestSqlServer.getList(); //Console.ReadLine(); //string sss = "njhloveyangjing"; //string rs = Helper.Security.SecurityHelper.Encrypt62(sss); //Console.WriteLine(rs); //begin query /* DbMap map = new DbMapSqlServer("server=192.168.104.117;uid=wftsa;password=jd7nTF#wM;database=K2Sln"); int i = 0; while (i <= 100) { Stopwatch sw = new Stopwatch(); sw.Start(); string sql = "SELECT top 100000 * FROM [K2Log].[dbo].[_ProcInstDataAudit]"; List<_ProcInstDataAudit> list = map.GetList<_ProcInstDataAudit>(sql); //List<_ProcInstDataAudit> list = new List<_ProcInstDataAudit>(); //System.Data.IDataReader reader = map.DbContext.GetReader(sql); //while (reader.Read()) //{ // _ProcInstDataAudit m = new _ProcInstDataAudit(); // m.Date = DateTime.Parse(reader["date"].ToString()); // m.Location = reader["location"].ToString(); // m.Name = reader["name"].ToString(); // m.ProcInstID = int.Parse(reader["ProcInstID"].ToString()); // m.User = reader["user"].ToString(); // m.Value = reader["value"].ToString(); // list.Add(m); //} sw.Stop(); Console.WriteLine(sw.Elapsed); i++;*/ }
public void InsertTest() { //DbMap map = new DbMapAccess(@"E:\快盘\project\CaiDown\CaiDown\down.mdb"); BaseModeCreate create = new SqlServerModeCreate("server=192.168.104.117;uid=wftsa;password=jd7nTF#wM;database=snda_data"); create.CreateAll("TestProject1", "snda_data", "",""); //string s = Helper.Str.StringHelper.SubStrContain("11111@ebasdasdas@ee19851022", "@eb", "@ee"); //Console.WriteLine(s); //begin query //DbMap map = new DbMapSqlServer("server=192.168.104.117;uid=wftsa;password=jd7nTF#wM;database=K2Sln"); //Stopwatch sw = new Stopwatch(); //sw.Start(); //string sql = "SELECT top 100000 * FROM [K2Log].[dbo].[_ProcInstDataAudit]"; ////List<_ProcInstDataAudit> list = map.GetList<_ProcInstDataAudit>(sql); //List<_ProcInstDataAudit> list = new List<_ProcInstDataAudit>(); //System.Data.IDataReader reader = map.DbContext.GetReader(sql); //while (reader.Read()) //{ // _ProcInstDataAudit m = new _ProcInstDataAudit(); // m.Date = DateTime.Parse(reader["date"].ToString()); // m.Location = reader["location"].ToString(); // m.Name = reader["name"].ToString(); // m.ProcInstID = int.Parse(reader["ProcInstID"].ToString()); // m.User = reader["user"].ToString(); // m.Value = reader["value"].ToString(); // list.Add(m); //} //sw.Stop(); //Console.WriteLine(sw.Elapsed); ////endquery }
protected void Page_Load(object sender, EventArgs e) { string conn = "server=192.168.104.117;uid=wftsa;password=jd7nTF#wM;database=k2Sln"; //object dt = db.ExecScalarInt(" select top 22 * from k2sln.dbo.TB_SNDA_Common_VirtualRole "); //Response.Write(dt); DbMap map = new DbMapSqlServer(conn); // string sql = "select top 1 * from k2sln.dbo.TB_SNDA_Common_VirtualRole where idx=27617"; // IDataReader dr = map.db.GetReader(sql); // VirtualRole1 role = map.Get<VirtualRole1>(sql); // Response.Write(role.Proccode); //insert : //VirtualRole1 vr = new VirtualRole1() //{ // Proccode = "njhtext", // RoleGroupCode = "njhtest", // RoleGroupName = "njhtest", // SpecialPersonid = "snda\\niejunhua", //}; ////int rs = map.Insert<VirtualRole1>(vr); //// Response.Write(rs); //vr = new VirtualRole1(); //vr = map.Get<VirtualRole1>(sql); //vr.Proccode = "njhprocvcode"; //int idd = map.Update<VirtualRole1>(vr); //Response.Write(idd); SqlServerModeCreate core = new SqlServerModeCreate(conn); core.CreateAll("", "K2SLN"); }
private BaseModeCreate GetCreator() { BaseModeCreate creator = null; string v = comboBox1.SelectedValue.ToString(); if (v == "Oledb") { creator = new AccessModeCreate(textBox1.Text); } else if (v == "MsSql") { creator = new SqlServerModeCreate(textBox1.Text); } else if (v == "MySql") { creator = new MySqlModeCreate(textBox1.Text); } return creator; }