Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2007, 02:05 PM
Registered User
 
Join Date: Mar 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginner :: Need help to bind the data in GridView

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


 
Old March 31st, 2007, 02:09 PM
Registered User
 
Join Date: Mar 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old March 31st, 2007, 04:26 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Cross post:

http://p2p.wrox.com/topic.asp?TOPIC_ID=58484

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner :: Need help to bind the data in GridView kajal C# 3 April 3rd, 2007 06:34 AM
Beginner :: Need help to bind the data in GridView kajal ASP.NET 2.0 Basics 2 April 2nd, 2007 01:21 AM
Beginner :: Need help to bind the data in GridView kajal SQL Server 2005 1 March 31st, 2007 04:26 PM
Data Bind Template Controls in Gridview wirerider ASP.NET 2.0 Basics 5 February 4th, 2007 07:20 AM
Bind GridView to Dataset bob_clegg ASP.NET 2.0 Professional 1 November 21st, 2006 08:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.