System.Data.Odbc.OdbcConnection con = new System.Data.Odbc.OdbcConnection(@"Driver={Microsoft Access Driver (*.mdb)};DBQ=F:\project\TyhGallery\db.mdb");
con.Open();
System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand("select * from users where user_name='" + name + "' and user_password='" + pwd + "'", con);
System.Data.Odbc.OdbcDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{ return true; }
else
{ return false; } 网上很多的 建议搜索下
con.Open();
System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand("select * from users where user_name='" + name + "' and user_password='" + pwd + "'", con);
System.Data.Odbc.OdbcDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{ return true; }
else
{ return false; } 网上很多的 建议搜索下
解决方案 »
- C#能访问某个PHP文件,却没有执行PHP文件里的指令,会是什么原因呢?
- C# 按Esc键后自动退出,不知道为什么代码没反应
- [急!]同时接收SQL存储过程的select结果集和output值
- 面向对象书籍
- Application.StartupPath 的问题?
- DataGrid的问题
- 导出excel 的 001 格式变为 1 的问题?
- 有没有办法了解有那些程序的执行
- 在xml文档中查找某个节点
- 怎样在WebForm上的TextBox中通过按钮在当前光标处插入字符串
- WebClient在win2k与winXp下运行结果不同?
- c# win form 文本文件中的數據新增到數據庫...求解..............
请参见此消息的结尾。************** 异常文本 **************
System.TypeInitializationException: “System.Transactions.Diagnostics.DiagnosticTrace”的类型初始值设定项引发异常。 ---> System.Configuration.ConfigurationErrorsException: 配置系统未能初始化 ---> System.Configuration.ConfigurationErrorsException: 配置文件 CallNumber.exe.config 没有根 <configuration> 标记 (D:\MyJob\Item\PR3\CallNumber\bin\Debug\CallNumber.exe.config line 2)
在 System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
在 System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
在 System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
在 System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- 内部异常堆栈跟踪的结尾 ---
在 System.Configuration.ConfigurationManager.GetSection(String sectionName)
在 System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
在 System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
在 System.Diagnostics.DiagnosticsConfiguration.Initialize()
在 System.Diagnostics.DiagnosticsConfiguration.get_Sources()
在 System.Diagnostics.TraceSource.Initialize()
在 System.Diagnostics.TraceSource.get_Switch()
在 System.Transactions.Diagnostics.DiagnosticTrace..cctor()
--- 内部异常堆栈跟踪的结尾 ---
在 System.Transactions.Transaction.get_Current()
在 System.Data.Common.ADP.IsSysTxEqualSysEsTransaction()
在 System.Data.Common.ADP.NeedManualEnlistment()
在 System.Data.Odbc.OdbcConnection.Open()
在 CallNumber.Form1.Form1_Load(Object sender, EventArgs e) 位置 D:\MyJob\Item\PR3\CallNumber\Form1.cs:行号 55
在 System.Windows.Forms.Form.OnLoad(EventArgs e)
在 System.Windows.Forms.Form.OnCreateControl()
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl()
在 System.Windows.Forms.Control.WmShowWindow(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
在 System.Windows.Forms.Form.WmShowWindow(Message& m)
在 System.Windows.Forms.Form.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)