1) string[,] param1 = new string[1, 2];
param1[0, 0] = "@userName";
param1[0, 1] = username;
2) string status = CommonClass.Common.Instance.getSingleValue("checkIsExistUserName", param1);
3) SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ValweaveFa"].ConnectionString);
SqlCommand sm;
public string getSingleValue(string procNm, string[,] paramVal)
{
try
{
myConnection.Open();
sm = new SqlCommand(procNm, myConnection);
sm.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paramVal.Length / 2; i++)
{
if ((paramVal[i, 0] != null) && (paramVal[i, 1] != null))
sm.Parameters.Add(paramVal[i, 0], paramVal[i, 1]);
}
string Password = Convert.ToString(sm.ExecuteScalar());
myConnection.Close();
return Password;
}
catch (Exception ex)
{
throw ex;
}
}
param1[0, 0] = "@userName";
param1[0, 1] = username;
2) string status = CommonClass.Common.Instance.getSingleValue("checkIsExistUserName", param1);
3) SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ValweaveFa"].ConnectionString);
SqlCommand sm;
public string getSingleValue(string procNm, string[,] paramVal)
{
try
{
myConnection.Open();
sm = new SqlCommand(procNm, myConnection);
sm.CommandType = CommandType.StoredProcedure;
for (int i = 0; i < paramVal.Length / 2; i++)
{
if ((paramVal[i, 0] != null) && (paramVal[i, 1] != null))
sm.Parameters.Add(paramVal[i, 0], paramVal[i, 1]);
}
string Password = Convert.ToString(sm.ExecuteScalar());
myConnection.Close();
return Password;
}
catch (Exception ex)
{
throw ex;
}
}
No comments:
Post a Comment