473,785 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Beginner :: Need help to bind the data in GridView using asp standard controls

16 New Member
I m beginner for ASP.Net 2005 with C# and SQL Server 2005.

I have created the form which contains many asp standard controls on it like label,textbox,c heckbox,dropdow nlist,command button.
The command button used are only to execute the different queries on click event.
I have put the GridView control which is used to show the database stored related to that form.
I m using SQL DataSource control for the connection.

Now,my problem is i m not able to write the proper SQL queries which insert,delete,u pdate or select from the GridView and Standard Controls.

In short,I have a command button set up on a form to run a SQL pass-through insert query after several field are filled in standard controls but I can't get .Please anyone could help me to provide the sample source code related to above controls used in the same form.

Thanxs

Mar 31 '07 #1
2 1488
Riaaaa
16 New Member
Please help me with some sample source code i m really in urgent need...
Want to create the project thenafter.

<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:companymaste r %>"
DeleteCommand=" DELETE FROM [Categories]
WHERE [CategoryID] = @CategoryID"
InsertCommand=" INSERT INTO [Categories]
([CategoryName], [Description])
VALUES (@CategoryName, @Description)"
UpdateCommand=" UPDATE [Categories] SET
[CategoryName] = @CategoryName,
[Description] = @Description
WHERE [CategoryID] = @CategoryID">
</asp:SqlDataSour ce>
<asp:GridView ID="GridView1" runat="server"/>

I have used the above code for the sql queries with sqldatasource control and gridview control.
Is any connection other than this required ??
What should be written in web.config ??

Pls provide proper guideline...

Is the code enough to complete what i needed if it's incomplete then pls help out
Mar 31 '07 #2
kenobewan
4,871 Recognized Expert Specialist
Here is an article that may help:
GridView
Apr 3 '07 #3

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

Similar topics

7
14820
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
1
9356
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes GridView.Visible = True. I press HIDE and the GridView disappears as expected. After it I press SHOW and the GridView doesn't show.
1
2313
by: Siva | last post by:
Hi, I have a 3 tier ASP.Net app for a handheld which needs to fetch orders from database via a DAL and populate it in a gridview using objectdatasource. In the search page I have a few parameters and when the search button is clicked I am sending those parameters via query string ( I need to do this since my app will run in a handheld which has certain restrictions). In the order list page, I am passing those parameters to the DAL as...
0
1888
by: yeltsin27 | last post by:
I need some advice on handling dynamically added controls in a GridView. My app takes an uploaded CSV file containing addresses, converts it to a DataTable, databinds the DataTable to a GridView, accepts information via dropdowns embedded in the first row of the GridView about which incoming fields should go to which database fields, and writes the data to the database. The incoming data has an arbitrary number of columns so I create...
1
13907
by: dhamo | last post by:
How to bind checkbox with gridview in asp.net 2.0 I take a gridview control and bind data dynamicaly using code.I taken backend tool as a Ms Access and now I want to add new column with checkbox so user can delete selected recored..So How can I bind checkbox with gridview...
1
2526
by: jaredciagar | last post by:
Hi guys...can you help me please.... I'm using ASP.net, MSSQL 2005 and VB Script I have don't know how to bind data in gridview control from database. I want also to allow paging in gridview so I want to bind data using datatable or dataset... Can you write the code for me in VB script? Thank You in advance.....
2
1492
by: Danielle | last post by:
All - Thanks in advance for any help you can provide. I've been working with a GridView in Visual Basic for a long time trying to get a list of contacts and to be able to edit and delete the contacts as well as send email on behalf of hte contact. I originally started with the built in update/delete functions of the gridview but I could never get them to work... then I created new pages that are launched on button clicks as shown...
2
1170
by: =?Utf-8?B?UGF1bA==?= | last post by:
Just wondering if anyone knows if this is possible with a gridview but I have a template column with two dropdown list boxes in it and when the user makes a selection in the first box I want to run an event that then takes the selected value of the first dropdown and feeds it into a stored procedure that returns a dataset that I want to display in the second dropdown list. If there is no data returned I want to hide the second dropdown...
12
2181
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a test page and I've managed to bind the usercontrol to a repeater and display some data in the following fashion: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1"> <ItemTemplate > <uc1:AUserControl runat="server"...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8979
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2881
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.