原来老师给我的时候数据库是用ACCESS做的
要求我改成SQL做的
然后我就用SQL重新做了
可能以前默认的数据库的连接地址是一个地方 我开始不知道
刚才知道了 所以就把扩展名是mdb一个数据库文件复制倒默认的那个地址
然后就可以运行了
所以更改的数据库还是原来的  
奇怪的是在.net环境里面的数据库连接我明明连接的是我重新做的SQL
可是修改的还是原来就有的数据库
我知道肯定代码里面还要改才能连接的我新做的数据库 可是怎么改呢?
还有奇怪哦 既然没有修改新的 那在.net环境里面怎么还显示连接上了呢?

解决方案 »

  1.   

    看不太明白,但是mdb和SQL在C#里连数据库是不一样的
      

  2.   

    如果你原来的是用ODBC连接数据库的话,
    修改后要重新配置数据源
      

  3.   

    谁帮帮我嘛 
    本来就不会的 是毕业设计
    比如下面的怎么改连接???谢Ooo...
      

  4.   

    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;
    using System.Data.OleDb; 
    namespace zhangli
    {
    /// <summary>
    /// Form1 的摘要说明。
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox textBox1;
    private System.Windows.Forms.TextBox textBox2;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Button button2;
    private System.Data.OleDb.OleDbConnection oleDbConnection1;
    private System.Data.OleDb.OleDbCommand oleDbCommand1;
    public string abc;
    private System.Windows.Forms.Button button3;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.Label label4;
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.Container components = null; public Form1()
    {
    //
    // Windows 窗体设计器支持所必需的
    //
    InitializeComponent(); //
    // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
    //
    } /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if (components != null) 
    {
    components.Dispose();
    }
    }
    base.Dispose( disposing );
    }