473,480 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

display a gridview using select statement of two column in one table

Hi.
I'm using asp.net and c# language.
How can i display a GridView using select statement of two column in one table?

This is my coding:
Expand|Select|Wrap|Line Numbers
  1. if (sdr.Read())
  2. {
  3.   if(namaPembekal.Equals(sdr["namaPembekal"]) && tarikhRo.Equals(sdr["tarikhRo"]))
  4.   {
  5.  
  6.     Session.Add("namaPembekal",sdr["namaPembekal"]);          
  7.     Session.Add("tarikhRo", sdr["tarikhRo"]);
  8.  
  9.     if((((String)(Session["namaPembekal"])).Equals("namaPembekal")) && ((String)(Session["tarikhRo"])).Equals("tarikhRo"))
  10.       GridView1.DataSourceID = SqlDataSource2.ID;
  11.     GridView1.DataSourceID = txtJourneyDate.Text;
  12.  
  13.   }
Please help me.
Thanks in advance...
Oct 24 '10 #1
1 2555
Frinavale
9,735 Recognized Expert Moderator Expert
I have no idea what you are trying to do in the code you posted.

From what I understand, you need to create a SQL Select statement that selects from more than one column. I'm not sure what you are having problems with in regards to this. Also, you have not posted code that pertains to your question.

Please provide more details.
Oct 25 '10 #2

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

Similar topics

4
2751
by: bob1660 | last post by:
I am new to PHP and MYSQL. I have a Database table with 4 field. FirstName, LastName, DateofBirth and MemberNumber. I would like to have a form where a user can fill in the FirstName, LastName and...
1
2555
by: bimeldip | last post by:
Hi, I have managed to create codes to display data from the database in a html page.I have gone on to create a page to allow users to manipulate the table via a html page. For instance users will be...
0
2058
by: bimeldip | last post by:
Hi, I have managed to create codes to display data from the database in a html page.I have gone on to create a page to allow users to manipulate the table via a html page. For instance users will be...
5
4352
by: konaravikumar | last post by:
writing a query to get the second highest value in atable by using select statement
3
1071
by: veer | last post by:
Hi this is a silly question but it is wasting of lot of my time actually i want to search a string in mdb file using select statement the string is CmpnyName ="killeen women's health center" ...
1
3735
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have a <asp:GridViewcontrol that is populated with records. The first column I display contains a "UserID" DataField. I've created my column using the following code: <asp:BoundField...
1
20790
by: themightyrhino | last post by:
I'm writing a process to perform multiple updates on a main table from information stored in different component reports. As you can see from the below, I'm using a select query to base the update...
1
3657
by: ncsthbell | last post by:
Once again... I am supporting another Access database that I did not build. The previous 'owner' of this built the tables with spaces in the table names as well as the column names. I am having a...
2
3115
by: Deepthi Bittu | last post by:
I create a table in oracle 11g with the default value for one of the columns. Systax is "create table xyz(emp number,ename varchar2(100),salary number default 0);". This created successfully. For...
0
6920
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...
1
6760
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
5365
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,...
1
4799
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
4501
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
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
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
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
206
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.