W
weird0
Below is the code I wrote but it aint working.... :
It throws an exception on DataBind() statement that "the source does
not support server-side paging".
PLz Help. Really stuck.
protected void Button1_Click(object sender, EventArgs e)
{
int AtmtransId=-1;
if (Session["CustomerId"]!=null)
AtmtransId=DataAccessLayer.ATMManager.getATMTransactionsID(Session["Custome
rId"].ToString(),AccNamesList.SelectedItem.Text);
string Query = "SELECT atmtrans_date AS Date,atmtrans_branch
AS Branch,atmtrans_type AS Type,atmtrans_amount AS Amount FROM
ATM_Transactions WHERE atmtrans_id=@ATMTRANSID";
SqlConnection sqlconnection = new SqlConnection(@"Data
Source=.
\SQLEXPRESS;AttachDbFilename=|DataDirectory|\BankingDb.mdf;Integrated
Security=True;User Instance=True");
SqlCommand cmd = new SqlCommand(Query,sqlconnection);
cmd.Parameters.AddWithValue("@ATMTRANSID",AtmtransId);
sqlconnection.Open();
SqlDataReader reader=cmd.ExecuteReader();
sqlconnection.Close();
GridView1.DataSource=reader;
GridView1.DataBind();
sqlconnection.Close();
}
GridView's AllowPaging Property is set to true with some function
defined to its corresponding property.
It throws an exception on DataBind() statement that "the source does
not support server-side paging".
PLz Help. Really stuck.
protected void Button1_Click(object sender, EventArgs e)
{
int AtmtransId=-1;
if (Session["CustomerId"]!=null)
AtmtransId=DataAccessLayer.ATMManager.getATMTransactionsID(Session["Custome
rId"].ToString(),AccNamesList.SelectedItem.Text);
string Query = "SELECT atmtrans_date AS Date,atmtrans_branch
AS Branch,atmtrans_type AS Type,atmtrans_amount AS Amount FROM
ATM_Transactions WHERE atmtrans_id=@ATMTRANSID";
SqlConnection sqlconnection = new SqlConnection(@"Data
Source=.
\SQLEXPRESS;AttachDbFilename=|DataDirectory|\BankingDb.mdf;Integrated
Security=True;User Instance=True");
SqlCommand cmd = new SqlCommand(Query,sqlconnection);
cmd.Parameters.AddWithValue("@ATMTRANSID",AtmtransId);
sqlconnection.Open();
SqlDataReader reader=cmd.ExecuteReader();
sqlconnection.Close();
GridView1.DataSource=reader;
GridView1.DataBind();
sqlconnection.Close();
}
GridView's AllowPaging Property is set to true with some function
defined to its corresponding property.