S
savvy
I'm trying to page a datagrid but the when i'm tying to fill the
DataSet with a table, I know that using DataAdapter.Fill you can
specify a single datatable to populate when the sp returns one table.
How do I fill my dataset when the sp is a combination of two tables.
i'm not able to understand how to fill it when i'm using a sql server
stored procedure as given below
any suggestions will be greatly appreciated.
Thanks for your help and time in Advance
-----------------------------------------------------
SELECT AJ.*, CD.* FROM AppliedJobs AS AJ, CVDetails AS CD WHERE
AJ.JS_ID = CD.JS_ID AND AJ.CV_ID= CD.CV_ID AND AJ.JobID=@job_id
-----------------------------------------------------
// and my DataSet in the ASP.NET appplication is which is not working
out ....
objDS = new DataSet();
objcmd = new SqlCommand("SelectJobAppliedCVDetails", objConn);
objcmd.CommandType = CommandType.StoredProcedure;
objcmd.Parameters.Add(new SqlParameter("@job_id",
Request.QueryString["id"]));
objDA = new SqlDataAdapter(objcmd);
objDA.TableMappings.Add("CVDetails1","AppliedJobs");
objDA.Fill(objDS, "CVDetails");
dgresponsedetails.DataSource = objDS.Tables[0].DefaultView;
dgresponsedetails.DataBind();
objConn.Close();
----------------------------------------------------------
DataSet with a table, I know that using DataAdapter.Fill you can
specify a single datatable to populate when the sp returns one table.
How do I fill my dataset when the sp is a combination of two tables.
i'm not able to understand how to fill it when i'm using a sql server
stored procedure as given below
any suggestions will be greatly appreciated.
Thanks for your help and time in Advance
-----------------------------------------------------
SELECT AJ.*, CD.* FROM AppliedJobs AS AJ, CVDetails AS CD WHERE
AJ.JS_ID = CD.JS_ID AND AJ.CV_ID= CD.CV_ID AND AJ.JobID=@job_id
-----------------------------------------------------
// and my DataSet in the ASP.NET appplication is which is not working
out ....
objDS = new DataSet();
objcmd = new SqlCommand("SelectJobAppliedCVDetails", objConn);
objcmd.CommandType = CommandType.StoredProcedure;
objcmd.Parameters.Add(new SqlParameter("@job_id",
Request.QueryString["id"]));
objDA = new SqlDataAdapter(objcmd);
objDA.TableMappings.Add("CVDetails1","AppliedJobs");
objDA.Fill(objDS, "CVDetails");
dgresponsedetails.DataSource = objDS.Tables[0].DefaultView;
dgresponsedetails.DataBind();
objConn.Close();
----------------------------------------------------------