首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

错误详细信息: System.Data.OleDb.OleDbException: 表 'table_user' 已存在

2011-12-08 
异常详细信息: System.Data.OleDb.OleDbException: 表 table_user 已存在。string conn ProviderMicro

异常详细信息: System.Data.OleDb.OleDbException: 表 'table_user' 已存在。
string conn= "Provider=Microsoft.Jet.OLEDB.4.0;";
  conn+=@"Data Source=D:\my.mdb";
  OleDbConnection myconnection = new OleDbConnection(conn);
  myconnection.Open();
  String sql_create_table_user = "create table table_user(userName text,userPwd text,userRole int)"; 
  OleDbCommand command = new OleDbCommand();
  command.Connection = myconnection;
  command.CommandText = sql_create_table_user;
  command.ExecuteNonQuery();

  String sql_create_table_role = "create table table_role(roleId int,roleName text)";
  command.Connection = myconnection;
  command.CommandText = sql_create_table_role;
  command.ExecuteNonQuery();






“/WebSite2”应用程序中的服务器错误。

表 'table_user' 已存在。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.Data.OleDb.OleDbException: 表 'table_user' 已存在。

源错误: 


行 29: command.Connection = myconnection;
行 30: command.CommandText = sql_create_table_user;
行 31: command.ExecuteNonQuery();
行 32: 
行 33: String sql_create_table_role = "create table table_role(roleId int,roleName text)";

源文件: d:\My Documents\Visual Studio 2008\WebSites\WebSite2\register.aspx.cs 行: 31 


[解决办法]
这个有什么好解释的吗?已经提醒得再清楚不过了,table_user表已经存在在库中了。你再Create当然不行
[解决办法]
好好学习 天天向上

热点排行