我在Windows 7专业版64位上安装oracle 11g企业版时遇到此错误.我检查了注册表,因为有人提到但正确的事情已经存在.如果尝试从Services.msc启动服务,它说服务也没有找到
每当我尝试从我的数据库中检索数据时,我都会变为空.我正在使用的代码如下:
protected void Button2_Click(object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection(GetConnectionString());
SqlCommand cmd = new SqlCommand("spSelectCustomer", myConnection);
cmd.CommandType = CommandType.StoredProcedure;
myConnection.Open();
SqlParameter custId = cmd.Parameters.Add("@CustomerId", SqlDbType.Int);
custId.Direction = ParameterDirection.Input;
custId.Value = 10;
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
Label1.Text = dr["FirstName"].ToString();
Label2.Text = dr["LastName"].ToString();
Label3.Text = dr[3].ToString();
Label4.Text = dr["Email"].ToString();
}
private static string GetConnectionString()
{
return ConfigurationManager.ConnectionStrings["Lab3ConnectionString"].ConnectionString;
}
Run Code Online (Sandbox Code Playgroud)