Static string connstr = system. configuration. configurationsettings. receivettings ["connstr"]. tostring ();
Public static sqldatareader getreader (string sqlspname)
{
Return sqlhelper. executereader (connstr, sqlspname );
}
Public static sqldatareader getreader (string sqlspname, Params object [] parameters)
{
Return sqlhelper. executereader (connstr, sqlspname, parameters );
}
Public static datatable gettable (string sqlspname)
{
Return sqlhelper. executedataset (connstr, sqlspname). Tables [0];
}
Public static datatable gettable (string sqlspname, Params object [] parameters)
{
Return sqlhelper. executedataset (connstr, sqlspname, parameters). Tables [0];
}
Public static dataset GetSet (string sqlspname)
{
Return sqlhelper. executedataset (connstr, sqlspname );
}
Public static dataset GetSet (string sqlspname, Params object [] parameters)
{
Return sqlhelper. executedataset (connstr, sqlspname, parameters );
}
Public static datarow getrow (string sqlspname)
{
Datatable dt = gettable (sqlspname );
If (Dt. Rows. Count> 0)
Return DT. Rows [0];
Else
Return NULL;
}
Public static datarow getrow (string sqlspname, Params object [] parameters)
{
Datatable dt = gettable (sqlspname, parameters );
If (Dt. Rows. Count> 0)
Return DT. Rows [0];
Else
Return NULL;
}
Public static int getnonquery (string sqlspname)
{
Return sqlhelper. executenonquery (connstr, sqlspname );
}
Public static int getnonquery (string sqlspname, Params object [] parameters)
{
Return sqlhelper. executenonquery (connstr, sqlspname, parameters );
}
Public static object getscalar (string sqlspname)
{
Return sqlhelper. executescalar (connstr, sqlspname );
}
Public static object getscalar (string sqlspname, Params object [] parameters)
{
Return sqlhelper. executescalar (connstr, sqlspname, parameters );
}