strSql = "select * from t_gbit_login where c_id='"+strID.Trim()+"'";
string myConnString="Provider=Sybase.ASEOLEDBProvider.2;Initial Catalog=DB_VDR;Password=123456;User ID=sa;Data Source=DBServer;Persist Security Info=True";
OleDbConnection myConnection = new OleDbConnection(myConnString);
OleDbCommand myCommand = new OleDbCommand(strSql,myConnection); myConnection.Open();
OleDbDataReader myReader;
myReader = myCommand.ExecuteReader();
// Always call Read before accessing data.
while (myReader.Read())
{
strName=myReader["c_name"].ToString().Trim();
strSex=myReader["c_sex"].ToString().Trim();
strRight=myReader["c_right"].ToString().Trim();
strPwd=myReader["c_pwd"].ToString().Trim();
iRows++;
}
myReader.Close();//为什么每次执行到这里程序就象死了一样,只有把网线拨掉,才会向下执行?!急啊
myConnection.Close();
解决方案 »
- wp7的模拟器如何模拟多点触控?
- 娘的 一个闪屏问题把我搞到现在 求高人来解答
- 正则表达式的问题.
- 菜鸟求教,自定义对话框的使用——设置画布大小
- c#建模软件
- 我C#开发的程序,如何安装的别地机器上,怎么打包才能把.net框架安上?
- 还是编码的问题
- 请问上传的图片和压缩包的路径变了,在前台页面不能显示已上传的图片和压缩包,这问题怎么解决?谢谢!
- C#将图片像素变低
- 如何处理 [**中检测到有潜在危险的 Request.Form 值。]
- 真的没有人用C#做sybase12.52的开发么?
- 为什么我调用OleDbDataReader.Close()和OleDbConnection.Close()的时候,程序就死了,不响应任何消息?
- some reports on problem using the above one, try the following as an alternative -"Provider=Sybase.ASEOLEDBProvider;Server Name=myASEserver,5000;Initial Catalog=myDBname;User Id=username;Password=password"
This one works only from Open Client 12.5 where the server port number feature works,allowing fully qualified connection strings to be used without definingany .IDS Data Source files.
就是在执行 myReader.Close();程序死住了