473,396 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help me update data by using textbox and datagrid.

Sorry for my bad Englush. I've designed a form like this



The textbox show the classID and the datagird will display the list of students of this class. Table Student in my database has classID field too, of course ! But I don't want to display column classID on datagrid. When I click Update button, I want to save all data has been change in datagrid and save the value of classID in the textbox into classID field in Student table. Can anyone help me ?
Thank for reading !
Feb 5 '07 #1
5 2333
iburyak
1,017 Expert 512MB
Make column width = 0

Good Luck.
Feb 5 '07 #2
Thank you ! But it seems your don't understand my question. I didn't get problem with displaying but with saving. My form display the ID of the class and all students of this class. The table Student in my databes has 6 columns: ID, Name, Sex, Birthday, Address and ClassID. ClassID will be displayed on the textbox and 5 remaining columns will be dislayed on the datagrid. When I click the Update button, I want to save all changes into table Student. All saved rounds have only one value in ClassID column (the value displayed on textbox). And I don't know how to save the value displayed on the textbox along with the value displayed on datagrid.
Can't anyone help me ?
Feb 5 '07 #3
iburyak
1,017 Expert 512MB
Can you execute statement like this?

[PHP]
Update Student Set
ID = datagrid1(0),
name = datagrid(1),
Sex = datagrid(2),
Birthday = datagrid(3),
Address = datagrid(4)
Where classID = Text1.text and ID = datagrid(0)[/PHP]
Feb 5 '07 #4
Thanks again but this can only save an row. User can type many rows in datagrid.
Feb 6 '07 #5
iburyak
1,017 Expert 512MB
Loop through all rows in a grid and save each

Thank you
Feb 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Manish | last post by:
Hey folks I am having a weird problem in ASP .Net. My page is in C#. I have a datagrid, which populates based on selection in drop down box on ASP page. This datagrid has template textbox colum in...
13
by: abdoly | last post by:
i wrote a code to update datagrid with the datagrid updatecommand but i cant get the updated values after being update that is the code private void DataGrid1_UpdateCommand(object source,...
2
by: naija naija | last post by:
Hello guys i made a Datagrid with Editing,Update and Cancel using VS.NET. to my surprise nothing is on the screen after compilation .. By code below:- Imports System.Data Imports...
7
by: Joe | last post by:
Hi, I’m new to asp.net. I want to create an asp.net page that allows user to edit the data. I have pasted my code below. I am able to display the data in a datagrid. At the bottom of the page...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
4
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this...
1
by: keith.walter | last post by:
My first asp.net app is almost "done" and I am stuck. Here is my situation: I have a "mother" page add_customer.aspx and a"child" user control add_group.ascx. On the mother page is an "add...
6
by: Frank | last post by:
Hopefully this is the correct group for this message. My previous post to (I assume) a non-.net group was not welcomed. I have a form with 7 text boxes that are all bound to fields of a...
7
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from...
2
by: andrew.roberts | last post by:
This is my second post now on this subject has I seem to be getting no where and the problem is really starting to bug me now. I can get a datagrid into an editable state but then neither the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.