473,407 Members | 2,306 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,407 software developers and data experts.

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

16
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,checkbox,dropdownlist,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,update 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 1469
Riaaaa
16
Please help me with some sample source code i m really in urgent need...
Want to create the project thenafter.

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:companymaster %>"
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:SqlDataSource>
<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 Expert 4TB
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
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...
1
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...
1
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...
0
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...
1
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...
1
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...
2
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...
2
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...
12
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.