If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > not bind in gridview properly

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Feb 2012
Posts: 16
not bind in gridview properly

Please help !!!
if we delete a record from the table it does not bind in grid view but in dataset it shows the exact records but after refreshing the page only its binds

Thanks in advance

protected void dgrMilkRecord_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
int intId = Convert.ToInt16(e.CommandArgument.ToString());

ds = new DataSet();
cmd = new SqlCommand("agent_collection_delete_both_sp", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@intp_id", dgrMilkRecord.Rows[intId].Cells[0].Text);
cmd.Parameters.AddWithValue("@inta_id", DropAgentCode.Text);
cmd.Parameters.AddWithValue("@varcollection_date", txtcollection_date.Text);
da.SelectCommand = cmd;

da.Fill(ds);
cmd = new SqlCommand("select_agent_record_sp", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@dttransdate", txtcollection_date.Text);
cmd.Parameters.AddWithValue("@intam_agentid", DropAgentName.SelectedValue);
cmd.Parameters.AddWithValue("@intpm_agentid", DropPMAgent.SelectedValue);
da.SelectCommand = cmd;
da.Fill(ds, "agentrec");

dgrMilkRecord.DataSource = ds.Tables["agentrec"];
dgrMilkRecord.DataBind();
}

}
Reply With Quote
Reply

Tags
asp.net

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On