|
My 1 cent to this
1) May be you can try using a staging table in db to store this temporay values and when the user hits save; copy from staging to the main table.
2) Or Create a view state object and add the data table to it.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
1) So have a set of duplicate temp tables in the database? Maybe use the user's id as the record IDs.
2) Question, why would you use view state over session objects? I guess the view state would save memory on the server but it wouldn't the increased page size slow down the user's browser? I guess using AJAX update panels would help with that.
Thanks for your response!
|
|
|
|
|
1) Ya, UserID,Session ID cound serve as he primary key and when the user clicks save copy and insert to the main table and delete the same from temp table.
2)
a) The good thing of View sate over the session variables is that you can dispose then once done with it.
b) Update panel does nothing more than hiding the user from seeing a full page refresh by interepting post back.Behind the Scenes it does everything that needs to be done with out its presence.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Hi, what I do in those cases, is set the related column in the child table as not required(allow nulls), then I save the parent data and I get the new ID, with that new ID I will fill all the child tables and then I save them.
Geek to the bone.
|
|
|
|
|
Create a custom class that's stored in Session with it's own Save() method that will write to the DB. The DataTable probably has more information than you need and will waste more memory by storing it in Session. You can bind all your GridViews to the class just as easy.
|
|
|
|
|
That seems like the best solution. Use an array to hold the data and built an interface around it.
Thanks!
|
|
|
|
|
Hi friends..
I am developing a Web application in ASP.net..I need to get the harddisk serial number of the users machine who are visiting my application(my web Page)..How to do that..? Someone help me with relevant code as early as possible..
Thanks In Advance..
Balaguru
|
|
|
|
|
that doesnt sound dodgy at all...
|
|
|
|
|
ASP.NET is a method for outputting HTML to a user's browser. No part of this ability allows you to interact directly with a user's computer.
Seriously, how do so many people who decide to write ASP applications misunderstand ASP?
|
|
|
|
|
Balagurunathan S wrote: as early as possible..
Given that the task is impossible, 'as early as possible' means never. As someone else said, why do so many people who post here have no idea what ASP.NET is, and how it works ? I recommend you buy a book on ASP.NET and read it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dear Graus..
Thx for ur valuable comments..Can u send me a book..?
Regards,
|
|
|
|
|
how to take background image for td
but 2 small images in left and right will be on background image.
please tell me solution.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
can you please explain in more detail
|
|
|
|
|
You can put img tags in side your table row, and I assume these will appear over the background image. Are you trying to put rounded corners on a table ? You can do this with CSS instead, if the background is solid, but if it's solid, you shouldn't use a background image at all, just set a background color.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I am using an ajax update panel and within it there is a gridview control with item templates that have a fileupload control and a button that uploads the file chose.
I know that AJAX has problems with regard to using fileupload's and this is the solution: http://www.codeproject.com/KB/ajax/simpleajaxupload.aspx[^]
This (trigger) does not work as my button is within the gridview's template columns and I get a runtime error saying that cdmUpload can't be found.
Is there any other way that I can reference the control so it can be found?
Or any other method where I can use the fileupload control within the updatepanel so it actually works?
Any help would be great.
Thanks
M
|
|
|
|
|
Ya you can do this.
1) Add a buton Say btnUpload Inside the update panel
2) In the button click event right the code to save the uploaded file in the server.
3) In the Updae panel trigger collection add a postback trigger for the btnUpload Conrol.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Thanks for your help, but i tried this, and the button control cannot be found as it is within the gridview's item template.
Is there no way to find the button other than:
<Triggers><br />
<asp:PostBackTrigger ControlID="TabContainer1" /><br />
</Triggers>
|
|
|
|
|
Hi to everyone!
I have one problem, when I want to make an update to some record in the table, I am entering the data for it, and instead just for one field, the UPdateCommand is putting the same data in all the fields. Example:
I have two fields: ID and Name. And I am making an update of the name, and it's changed all the data for all the fields under Name. I think that I should use some WHERE statement, but I am beginner in SQL and every help will be appreciated. Thx
Example, before update, I had:
ID:1
Name:a
------------
ID:2
Name:b
-----------After update-------------
Update name: "c"
ID:1
Name:c
------
ID:2
Name:c
-------
|
|
|
|
|
use where id = 'whatever one you want to update'
|
|
|
|
|
well, when I am putting WHERE [id]=@name I get this error:
Conversion failed when converting the nvarchar value 'edenss' to data type int.
and when I am putting WHERE [id]=@id I get update of all the fields where the ID is existing.
|
|
|
|
|
where id = @id should work
you need to make sure it is jus selecting the one id
can you post your whole code
|
|
|
|
|
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="">]]>"
SelectCommand="SELECT * FROM [tblname]" InsertCommand="INSERT INTO tblname(name) VALUES (@name)"
UpdateCommand="UPDATE [tblname] SET name=@name WHERE id = @id">
<insertparameters>
<asp:parameter name="name">
<asp:parameter name="name">
|
|
|
|
|
where is @id declared, what is it? textbox value, hardcoded value?
|
|
|
|
|
id is just a field in the table, it's of type identity and is incremented for one with adding one more record in the table, something like autonumber in MS Access. With @id I think it should update the field with the current id is open. As I told you, I am a beginner so maybe I did some mistake, and any help will be appreciated. Thanks ahead
|
|
|
|
|
let me give you an example of an update statement
SqlCommand sqlcommand = new SqlCommand("as_insert_command",
sqlConn);
sqlcommand.CommandType = CommandType.StoredProcedure;
SqlParameter para1= sqlcommand.Parameters.Add("@id",
SqlDbType.Int, 4);
para1.Value = textboxid;
see the @id is set against a textbox id
so if someone enters a value in the textbox, that value will update the id
is this what you are trying to achieve
the id needs to be set somewhere this is why i am confused
|
|
|
|