473,546 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
+ 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 2564
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
2756
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 date of birth, and a select statement will return the membernumber bases on the user input. This is how i would execute a script without user input....
1
2566
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 able to change field name or data type of field But the problem that i'm facing currently is that i am unable to display the list of fields on the...
0
2068
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 able to change field name or data type of field But the problem that i'm facing currently is that i am unable to display the list of fields on the...
5
4361
by: konaravikumar | last post by:
writing a query to get the second highest value in atable by using select statement
3
1082
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" and select statement is sOldQuery = "select CMPNYNM from " & txtOldTableName.Text & " where CMPNYNM = '" & NewCmpnyName & "'" it produces the...
1
3746
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 DataField="UserID" /> When the user clicks on a row, I'd like to get the current value of the UserID column for the current row, as I want to use this...
1
20810
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 on. UPDATE DELTA_OD001_TMP TD SET (ORDER_DATE,VET_NO, VET_SCORE, VET_DECISION, PARTNER, ORANGE_ID) =(SELECT ORDER_DATE, VET_NO, VET_SCORE,...
1
3676
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 difficult time getting the select statement to work. I am getting a run-time error 2342. "A RunSql action requires and arguement consisting fo an SQL...
2
3120
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 some reasons I need to create another table with same old table structure and data. So i created a new table with name "abc" as "create table abc as...
0
7507
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
7435
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
7698
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
7947
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...
1
5361
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
3492
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
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
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...

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.