C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






View Message



Sender Macson

Recipient(s) Macson

Date 25 Sep 2009


Let Me Know Wht IS error

public int executeScalar(string strCommandText,Hashtable arParam)
{
int Count=0;
try
{
SqlCommand cmd = new SqlCommand(strCommandText);
cmd.Connection = con;
con.Open();
cmd.CommandType = CommandType.StoredProcedure;

if (arParam != null)
{
foreach (DictionaryEntry objParam in arParam)
{
cmd.Parameters.Add(objParam.Key.ToString(), objParam.Value);
}
}

Count= Convert.ToInt32(cmd.ExecuteScalar());

cmd.Dispose();
cmd = null;
}
catch
{
}
finally
{
con.Close();
}

return Count;
}


public int executeNonquery(string strCommandText, Hashtable arParam)
{
int Count = 0;
try
{
SqlCommand cmd = new SqlCommand(strCommandText);
cmd.Connection = con;
con.Open();
cmd.CommandType = CommandType.StoredProcedure;

if (arParam != null)
{
foreach (DictionaryEntry objParam in arParam)
{
cmd.Parameters.Add(new SqlParameter(objParam.Key.ToString(), objParam.Value));
}
}

Count = Convert.ToInt32(cmd.ExecuteNonQuery());

cmd.Dispose();
cmd = null;
}
catch
{
}
finally
{
con.Close();
}

return Count;
}






dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use