error details:
BaseDB.GetDataTableUsingQuery(SqlCommand oCommand, String sqlQuery) in e:\ClickPerk files\SampleSwan\App_Code\BaseDB.cs:57
Sample.GetNewSamplesWithCategories() in e:\ClickPerk files\SampleSwan\App_Code\Sample.cs:50
_Default.BindSamples() in e:\ClickPerk files\SampleSwan\Default.aspx.cs:16
_Default.Page_Load(Object sender, EventArgs e) in e:\ClickPerk files\SampleSwan\Default.aspx.cs:12
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +95
System.Web.UI.Control.LoadRecursive() +59
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678
*******************BaseDB.cs*****************
public static DataTable GetDataTableUsingQuery(SqlCommand oCommand, string sqlQuery)
{
SqlConnection oConn = GetConnection();
DataTable oTable = new DataTable();
oCommand.Connection = oConn;
oCommand.CommandText = sqlQuery;
oCommand.CommandTimeout = 90;
oCommand.CommandType = CommandType.Text;
SqlDataAdapter oAdapter = new SqlDataAdapter();
oAdapter.SelectCommand = oCommand;
try
{
oAdapter.Fill(oTable);
}
catch (Exception e)
{
throw e;
}
return oTable;
}
**************Sample.cs*****************
public static DataTable GetNewSamplesWithCategories()
{
return BaseDB.GetDataTableUsingQuery(new SqlCommand(), "SELECT TOP 8 s.*,c.* FROM Samples s LEFT JOIN Categories c on c.CatID=s.CatID ORDER BY SampleID DESC");
}
**************Default.cs*******************
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) BindSamples();
}
private void BindSamples()
{
DataTable dt = Sample.GetNewSamplesWithCategories();
rptSamples.DataSource = dt;
rptSamples.DataBind();
}
What I have tried:
I downloded the code and .bak file from ftp server and restored it in my local machine database[React2Media] and I changed the connection string and database name in aspx page. Now I'am stuck with the above error. When I followed through the stack trace there was no 'Sample' table in the database. I've pasted the necessary code above and checked 'categories' table to be present but no 'sample' table. Please assist on what is missing, what to add on as I'am new to .net.