First off I'm using VS 2008 C# (3.5 Framework) and Linq2Sql for ORM. I have a gridview that represents a SQL database table. I want a users to be able to double-click the rows and get the edit items then be able to edit them and move on without them committing the changes to the database until the user clicks the save button. I know how to make the gridview work and all, my issue is that currently I'm having to keep session objects for the table data and edit them as opposed to a Linq2SQL datasource (because that seems to always automatically commit the change to the database). Also, I'm having trouble getting the changes in the edit controls to reflect in my session data objects. Does anyone have any great working examples of doing this type of work in a gridview. I know there are a lot, but I don't see any with Linq2SQL and not committing changes to the database immediately. Sorry I'm usually a back system developer, so I'm not a UI guru.
I have details view on a aspx page that contains two DropDownList control in a TemplateField one works and selected value is updated in the database and one will not up date the database , i have spent hours looking for the reason why the Yard field is not updated with the select value from the dropdown list in the templatefield called DropDownList1.
I have a formview to insert data into a DB. Works great... I would also like to send an email after the user submits the form. I put the mail message code on the .cs page and it worked great!!!! Except it did not update the DB.......I really need it to do both......... but one or the other works fine
I have a DataList that on Update calls a function "DataList1_UpdateCommand" to update the data
OnUpdateCommand="DataList1_UpdateCommand"
It does not actually update the new value typed in. I placed a debug on the line below, but the text in the "FieldBalance" displays the original value and not the updated value, but the web pages does display what I typed in and not the original.
Dim FieldBalance As TextBox = CType(e.Item.FindControl("txtBalance"), TextBox) Below is the DataList code and the DataList1_UpdateCommand sub
I have a page where I want to let the users vote on displayed items. My customer wants this done with an image and a VOTE FOR THIS link. The link and image are to disappear once the user has voted, and be replaced with the number of votes for that item. I've made the VOTE FOR THIS link a link button. I'm have two problems:
1) the ListView1_ItemCommand code is always excecuted twice, so the vote count is being incremented by two, not one each time someone votes.
2) A page refresh causes the ListView1_ItemCommand code to run (twice) so a page refresh also casts two votes for the item
If it makes a difference, I display one item per page.
I have an updatable Gridview control that I cannot seem to URL encode a textbox in one of the columns. I cannot encode some of the other controls in the row, so the solution from the msdn site doesn't work in my case. I only want to encode the single textbox. However, with the code I have, I don't get any errors, and the database is updated, but the column that is edited becomes empty in the database. Here is what I have in the gridview rowupdating:
I've the user creation form where a user will be created by entering username. Below that is checkboxlist for UserGroup which is binded with the dataset with the all the usergroup. Hence up on entering the username and checkbox selected(as the user can belong to multiple UserGroups).At database end, there are basically 3 tables-
So when i click create new user, the UserId along with GroupID(whichever checked) is saved into UserToGroup table.Im relative to this kind of process and hence facing setbacks. Can somebody help in end to end process. From front to DB SP.
My problem is i need to update only the database name in current connection string in web.config at runtime....
this is the sample code .. to update connection string . but it updates the name of connection string  i need to change the database name of connection string !
public static void UpdateConnection(string name, string connString) { var webConfig = new ExeConfigurationFileMap { ExeConfigFilename = GlobalSettings.FullpathToRoot + "web.config" };
when i checked the checkboxes(not all) ,corresponding rows data has to be updating when i click save button which is outside of gridview,Its just same like our gmail delete button.
I've been googling for 2 days for the solution, but I couldn't find something useful. The problem is that I have GridView that is connected to the SQL database and that is how it is being populated. I added EDIT and DELETE buttons in the columns, but as far as I can see the event which handles them is empty.
I have an app where i have a GridView connected to a DropdownList....The selectedIndexChange determines what the gridview shows. Then have coded in the row editing event the ability to change the information in the row. MY ISSUE- cant take the new information changed in the row and update it in the database. I have a row updating event that im trying to figure out how to attach it to my stored proc and the newly edited row
i am updating data using editcommand by listview.. i got data max 50 depends on customers sometimes it has a few in the database. i am using listview and sqldatasource. when i update using editcommand in listview. it doesnt update relevant rows. it update to all data in database. why.. i have provided datasoure and list view.
I do have a listbox control and a button to update values of the list box with few other values of the form to the database. If i select 3 values in the listbox, it has to update the database in 3 rows (Unique for Listbox value) with the other value being the same. I use a details value for inserting values.
("Working_Hour") = (Convert.ToDateTime(dr(4)) - Convert.ToDateTime(dr(3))) + (Convert.ToDateTime(dr(6)) - Convert.ToDateTime(dr(5))) + (Convert.ToDateTime(dr(8)) - Convert.ToDateTime(dr(7))) '"if entries are 6 then add this line in working hour
I am new with the subsonic, and I have a problem when trying to update the database from the sql server. I have created a gridview by still is not returning the updates results. can you please help me? its getting an error code on dc.AddMostaHse(); (Cannot implicity convert type 'void to 'object')
I am trying to update the table records by intering a new values in a textbox
and am facing problems in the code of dataset
how could I perform that
[code]....
You should post any code that you are having problems with in the thread (because apparently some people can't open the files attached).
Anyways, you need a TextBox on the page. Then you need to access the Text in the TextBox (using the TextBox.Text property). Once you've got that you should use it to update your database.
The best way to supply this value (that has been provided by the end user) is to use the SqlCommand.Parameters property (if you're using the SqlCommand object).
This topic is covered nicely in:
How to use database in your program Part 1 How to use database in your program Part 2
Depending upon some condition I want to send the mail to the xyz user which will have two links "Accept" and "Reject" in the message body. When the recepient clicks either of the link an update/insert should be performed in the database against a particular record. For this , when I will be sending the mail, I will be requiring to send some unique Id along with the mail depending upon which I will be able to decide which record to update in the database. I am using SQl Server 2008 and C#.net. Does any one know how to implement it in VS 2008.
I get some data from the database that I want to use to update another Database row.I know how to do that if I put the first value on a label and then use that.//First I get the Name I want