|
I m not reposting sir i m it proper explanation so that u can understand and give answer any way sry please tell me the answer that is not helping me
modified on Tuesday, August 25, 2009 7:37 AM
|
|
|
|
|
Amit Patel1985 wrote: i m it proper explanation so that u can understand
Then You should modify the existing message rather than new post.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hey man sorry from i will keep this thing in mind but please help to find the solution this time......
Firefox is displaying this message.
To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.
thanks ,
Amit Patel
|
|
|
|
|
Amit Patel1985 wrote: hey man sorry from i will keep this thing in mind but please help to find the solution this time......
Its alright Amit.
Amit Patel1985 wrote: Firefox is displaying this message.
To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.
Actually I didn't see your last message. Where is it ? Or you just explain me where is your problem, so that I can help you out.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
at the top of this post i described my probs.
Thanks
|
|
|
|
|
Well, as I said, install firebug and debug JS. Firebug is an excellent tool and can tell you where exactly is the problem.
|
|
|
|
|
N a v a n e e t h wrote: Firebug is an excellent tool
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi ,
I am doing this from .vb file so how to debug this.
Thanks ,
Amit
|
|
|
|
|
Hello All,
I am using GridView in my application but not its edit feature due to some reason.
I am editing data manually by writting code.
Problem is when i update data, it is updating in database but its not showing immediately in my GridView.
Can anyone tell me how to reflect changes immediately in GridView.
Thanks,
Nagendra.
|
|
|
|
|
u Call the bind method outside postback or after saving call the bind method
|
|
|
|
|
No, i have used inbuilt SqlDataSource with GridView but just for displaying data.
I am doing editing manually, which don't have any connection with SqlDataSource.
|
|
|
|
|
You need to re-bind the gridview after update. If you are binding the gridview on page_load , ensure you are doing IsPostBack check.
|
|
|
|
|
after updating have u loaded the gird?
once show the code
|
|
|
|
|
just call the bind method after the update precess is done.
|
|
|
|
|
I tried this, but it didn't worked.
|
|
|
|
|
This is my code for GridView and DataSource
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="LocationCode" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:CommandField ShowSelectButton="True" SelectText="Edit" />
<asp:BoundField DataField="LocationCode" HeaderText="Location Code" ReadOnly="True"
SortExpression="LocationCode" />
<asp:BoundField DataField="LocationDesc" HeaderText="Desciption" SortExpression="LocationDesc" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=COMP2;Initial Catalog=Inventory;User ID=sa;Password=pes"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [LocationCode], [LocationDesc] FROM [Location_Master] ORDER BY [LocationCode]">
</asp:SqlDataSource>
I am editing data in database manually by using SqlCommand class ExecuteScalar method like this.......
protected void btnSave_Click(object sender, EventArgs e)
{
//This method will update a record into Location_Master table
try
{
string connectionString = ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection connection = new SqlConnection(connectionString);
connection.Open();
string save = "";
//String for updating a record into table
save = "update Location_Master set LocationDesc='" + txtBoxLocDesc.Text + "',CreatedBy='"+Session["userName"].ToString();
save = save + "',LastUpdateDate='" + System.DateTime.Now + "' where LocationCode='"+txtBoxLocCode.Text+"'";
SqlCommand saveCommand = new SqlCommand(save, connection);
int rowsAffected = saveCommand.ExecuteNonQuery(); //Store the no. of rows added or updated
connection.Close();
}
catch (System.Exception ex)
{
lblMessage.Text = ex.Message;
lblMessage.Visible = true;
}
}
After clicking that Save button, database is updating, but changes are not reflecting to GridView, i have to execute my application again to see changes in GridView.
|
|
|
|
|
SORRY for posting so large post, but i can't help it.
|
|
|
|
|
You have to use ExecuteScalar instead of ExecuteNonQuery .
int rowsAffected =(int) saveCommand.ExecuteScalar();
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
I don't think this will make much difference, we mostly use ExecuteNonQuery for updation purpose, i am getting my updations fine.
|
|
|
|
|
After updating the data base u need to bind data again with grid view again bind then data will come
gridview1.databind();
I hope this will u out
modified on Tuesday, August 25, 2009 7:29 AM
|
|
|
|
|
After update, call GridView1.DataBind() .
|
|
|
|
|
Hey thnx for all of those suggestions, i have worked it.
I call DataBind method both after making updation and also in Page_Load and it starts working.
I combined most of ur views.
Thanks to all again.
Nagendra.
|
|
|
|
|
Hello all, i have an application and it is giving me the error child node not allowed in web.comfig .
how should i proceed ?
|
|
|
|
|
|
Hi,
How to crete User control Dynamically?
Regards
Jayabharathi
|
|
|
|