S
Shawn Convington
Hey,
I am facing a problem which seems srange to me. I have a simple dll
class file i have created in its own projected, so it can be inherited
and used by others (for example security.dll here).
I have a method here whhich takes the sql statement the sql string and
returns the result from database as dataset.
Here is the code:
/**************
public DataSet ExceuteDataSetQuery(string sqlProcedure)
{
//returns dataset reults depending upon the stored procedure
or view called from database
objConn = new SqlConnection(_connectionString);
DataSet ds = new DataSet();
myAdapter = new SqlDataAdapter(sqlProcedure, objConn);
try
{
objConn.Open();
myAdapter.Fill(ds);
}
catch (Exception ex)
{
_message = ex.ToString();
}
objConn.Close();
return ds;
}
***************/
it works like charm, but i am kinda lost on what to do if error happens
and user is sent to catch block.
I try to use Response.Redirect("errorPage.aspx"), but that doesn't
work, it is not recognizinf repponse.redirect here! Eventhough, I have
inherited all the right classes correctly...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Data.SqlClient;
i dont know what else to do, also it does recognize the simple session
messages wither. Session["Userid"]=33 for example.
Do we have limit when we are compiling and creating cs files as dll
files? If yes, then it seems strange to me, let me know thanks
shawn
I am facing a problem which seems srange to me. I have a simple dll
class file i have created in its own projected, so it can be inherited
and used by others (for example security.dll here).
I have a method here whhich takes the sql statement the sql string and
returns the result from database as dataset.
Here is the code:
/**************
public DataSet ExceuteDataSetQuery(string sqlProcedure)
{
//returns dataset reults depending upon the stored procedure
or view called from database
objConn = new SqlConnection(_connectionString);
DataSet ds = new DataSet();
myAdapter = new SqlDataAdapter(sqlProcedure, objConn);
try
{
objConn.Open();
myAdapter.Fill(ds);
}
catch (Exception ex)
{
_message = ex.ToString();
}
objConn.Close();
return ds;
}
***************/
it works like charm, but i am kinda lost on what to do if error happens
and user is sent to catch block.
I try to use Response.Redirect("errorPage.aspx"), but that doesn't
work, it is not recognizinf repponse.redirect here! Eventhough, I have
inherited all the right classes correctly...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Data.SqlClient;
i dont know what else to do, also it does recognize the simple session
messages wither. Session["Userid"]=33 for example.
Do we have limit when we are compiling and creating cs files as dll
files? If yes, then it seems strange to me, let me know thanks
shawn