473,548 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Server Data base connection in ASP.NET

1 New Member
I am using Visual Web Developer and the form contains two SQLDataSources that are linked to two GridViews.I am trying to link a parameter in the first SQLDataSource component with a field returned by the other SQLDataSource component. Both contains a stored procedure that returns a set of data that has a master/child relationship. I cannot find any obvious way of doing this which is a very simple task on other platforms.
To link a parameter to an input control is trivial but I want the data in the second Griview to show a different set of data depending on the user selection in the first Gridview.

Would be very grateful for any pointers in the right direction.

TCooper.
Feb 23 '07 #1
2 1217
kenobewan
4,871 Recognized Expert Specialist
So you want to use the first datasource in the page load event and populate the first gridview. Then you want to use the event triggered by the user selection to insert as a parameter with your second datasource to create a child gridview. Is this what you are trying to achieve?
Feb 24 '07 #2
rashmitha reddy
6 New Member
HI,

I suppose you wanted to get the data in second grid based on the first datasource.If it is so you can do one thing take a field by which you wanted to get the data in second grid .Go to the template column on your first grid and declare a lable Id of that particular column and add object reference in your code.
For Ex- Label lblId=new Label( );
lblId=(Label)e. items.cells[ No . of that field].findcontrol(lb lId);
then bind your second grid for that Id.using your Sp get the required info in your datagrid Itemcommand only.
Feb 24 '07 #3

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

Similar topics

7
3286
by: rdh | last post by:
Hi all, I am in process of developing a Server in C++ supporting multiple protocols. The server will be exposing various functionalities, and the clients can communicate over any of the protocols may be TCP, IPX, SAP, NETBEUI to access the server to access the functionalities exposed. The server doesnot know in advance which client is using...
4
5640
by: Andreas Lauffer | last post by:
Can anyone tell me advantages / disadvantages of DataDirect Server Wire ODBC-driver? Any experiences? What about redistribution? Andreas Lauffer, easySoft. GmbH, Germany
13
2255
by: Edward Mitchell | last post by:
I have a problem that involves the error I receive when attempting to complete the asp.net web application example (Walkthrough: Creating a Web Application Using a Third-Party Business Object). When I first create the SQL connection in VS.NET 2003, I test the connection and everything works fine. However, when I attempt to run the first...
2
5033
by: djamilabouzid | last post by:
Hi! I have some problems with ms sql server database connection. When I wrote the following function (in VB): sub Remplir_Theme() Dim connectionString As String = "Data Source=.\SQLExpress; AttachDbFileName=|DataDirectory|\BasedeDonnees_babySQL.mdf ;Integrated Security=true; User Instance=true" Dim sqlCon As new...
4
3592
by: Engineerik | last post by:
I am trying to create a socket server which will listen for connections from multiple clients and call subroutines in a Fortran DLL and pass the results back to the client. The asynchronous socket client and asynchronous socket server example code provided in the .NET framework developers guide is a great start but I have not dealt with...
8
1121
by: Omar Abid | last post by:
Hi, I'm Trying to make a program with vb2005express that connect to any Microsft SQL data base and show it's table. I'm having some problems can anyone help me? Omar Abid
3
3251
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual Studio 2005 SP1 and had it working perfectly on my Windows XP machine on SQL Server 2005 Express. I decided to publish this application to a test...
16
4901
by: Omar Abid | last post by:
Hi every body, Im using VB 2005 to create a program that open SQL Data base The problem that i want to detect the tables of a database so how can i know a data base tables instantly Thank you omar.abid@hotmail.com omar.abid2006@gmail.com Omar abid
10
1524
by: lildiapaz | last post by:
Hi, Everyone I am trying to connect to an SQL 2000 server in c# using a windows application. What I'm trying to do is ask the user to type in the server name and from the user's input take that server name that they enter in and connect to that server. i also want them to enter a user name and password (SQL authentication) and hide their...
1
5105
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from the control unit and store them into the Sql server - The operation console then retrieve this data from the sql for reporting and statistics...
0
7518
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...
0
7444
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...
0
7711
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. ...
0
7805
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6039
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...
1
5367
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...
0
5085
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...
0
3497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.