To find the count from a table by joining two tables

Posted by Gokul under Sql Server on 2/28/2012 | Points: 10 | Views : 762 | Status : [Member] | Replies : 3
HI friends,
I am designing a online travels application. In this, in the ticket availability page, i have placed a gridview which should show the details on the services avilable from from and to option. In Sql table, i have seats available. When the user clicks the check avialablity button in grid, the message box should display with no of setas avilable> How to proceed this.

Thanks and Regards,
GokulNath Nithy.



Responses

Posted by: Pradeepkumar417 on: 2/28/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Create a view and insert data from two tables with sql joins. Then you have to get the row count from this view. or you have to bind this data to dataset from this view and then you can get the count like below.

 int i = ds.Tables[0].Rows.Count;


Thanks & Regards,
Software Engineer,
Pradeep Kumar

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pmithun121085 on: 2/28/2012 [Member] Starter | Points: 25

Up
0
Down
When Click on Button take the count something like this Select count(*) from tablename where availability = 1..
if value returns 0 then show that seat is not available.but for each seat number u shld hve status whether the seat is occupied or not.. i hope his will help u..plss feel free to ask if u hve any doubt

Mithun P

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/28/2012 [Member] Starter | Points: 25

Up
0
Down
on button's click event , i mean on Itemcommand's event ,

fetch the available seats from table and display that on messagebox.

-Neer

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response