473,473 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code to passing textbox values to gridview in C#.net

10 New Member
how can i pass textbox value to gridview using C#.net at runtime not using database values.

i m hving textbox1 and gridview1.

can anyone suggest me to do this coding in ASP.NET(C# language).
Apr 1 '08 #1
8 5202
nateraaaa
663 Recognized Expert Contributor
Will the textbox value be used in every row in the gridview? Or just as one cell value in your gridview?

Nathan
Apr 1 '08 #2
tina2626
10 New Member
Will the textbox value be used in every row in the gridview? Or just as one cell value in your gridview?

Nathan

Thanks 4 replying me,

i got d answer, i used datatable to do this, passing values from textbox to gridview.

but now i need to pass the value from gridview to Database.

can u suggest me for this with ASP.net(C#) code
Apr 1 '08 #3
nateraaaa
663 Recognized Expert Contributor
Go to the Howtos tab at the top of this site. Look for an article about using ADO.NET in your application under .NET.

Nathan
Apr 1 '08 #4
tina2626
10 New Member
Go to the Howtos tab at the top of this site. Look for an article about using ADO.NET in your application under .NET.

Nathan

Thank u,

But i didnt find any answer. give me some code suggestions. is it possible to delete a datatable values in gridview, using Delete button in gridview.

Plz do suggestions on this
Apr 2 '08 #5
nateraaaa
663 Recognized Expert Contributor
See this thread on how to use ADO.NET in your application.

http://bytes.com/forum/thread635615.html

Yes you can delete items from your gridview with a delete button. If you are populating the gridview using a database you will want to delete the item from your database and then repopulate your gridview with the newest version of data from your database.

Nathan
Apr 2 '08 #6
tina2626
10 New Member
See this thread on how to use ADO.NET in your application.

http://bytes.com/forum/thread635615.html

Yes you can delete items from your gridview with a delete button. If you are populating the gridview using a database you will want to delete the item from your database and then repopulate your gridview with the newest version of data from your database.

Nathan


i m not using database, i m jst passing the value from textbox to grid using DataTable.

i need to delete this value from grid. is it possible to do this.
Apr 2 '08 #7
nateraaaa
663 Recognized Expert Contributor
How are you loading the data in your gridview? dataset, datatable, etc. Whatever object you are using as the datasource for your gridview needs to be updated with the deletion. Then just bind that object to your gridview again and the gridview should be updated.
Apr 2 '08 #8
tina2626
10 New Member
How are you loading the data in your gridview? dataset, datatable, etc. Whatever object you are using as the datasource for your gridview needs to be updated with the deletion. Then just bind that object to your gridview again and the gridview should be updated.


I m using this code in C#.net, for dynamic creation of GridView without using DB.

<CODE>

AddDataToTable(TextBox1.Text.Trim(), TextBox2.Text.Trim(),Label2.Text, (DataTable)Session["myDatatable"]);

GridView1.DataSource = ((DataTable)Session["myDatatable"]).DefaultView;
GridView1.DataBind();
}
}


</CODE>
tell me Delete Command in gridview using this know of code. i need the code for insert value in to DB through Gridview

Thanks in Advance
With Regards
Tina
Apr 2 '08 #9

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

Similar topics

7
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
1
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
4
by: rohitscripts | last post by:
I need to fill my gridview with the values that are entered into textboxes. For this, i thought to fill a datatable with the textbox values first and then bind this datatable to my gridview. Could...
0
by: sandhyamn | last post by:
hi....i am writing a jsp code for uploading file inside a folder using multipart/form-data.but also i want to write textbox values in to that file, but the textbox values is not coming. ie..textbox...
0
geo039
by: geo039 | last post by:
I have a usercontrol with textboxes. Most of which refer to a gridview on selection. A user clicks a looking glass and a gridview appears to select items (like a dropdown). The page loads with...
1
by: Andy B | last post by:
I have this code: protected void EditEventsWizard_NextButtonClick(object sender, WizardNavigationEventArgs e) { //get the values from the DetailsView TextBox StartTime =...
5
by: jmartmem | last post by:
Greetings, I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few. Upon clicking the 'submit' button, I want the...
1
by: adepvivek | last post by:
Hi everybody, I am using textbox in gridview as template. And I want to stored the value of textbox. For that I want to pass the textbox value to stored procedure. So please give me solution.
0
by: Venkata Krishnam Raju | last post by:
Unable to find the Textbox in Gridview which Template controls created dynamically
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.