Your question is vague. Do you want to select data from 2 tables for 2 controls? Do you want to join the tables? Inner or outer join? Are you looking for code, the SQL statement, or what? What do the tables look like? What information do you want from the tables?
sorry....i want to select data from 2 tables using 1 control button.i want to join the tables.i've tried some code but it stil error.....it goes direct to catch..
ok like this....i'll explain it to you......
noRo(PK),tarikhRo,noPo,pecahanVott,idPemesan n idPembekal
noRo(PK),idBarang,kuantiti,jumlah,tempoh,status and catatan
i want to join this 2 tables and view it using one button in a gridview...
i want to select certain information....from table1:tarikhRo,idPemesan and idPembekal
from table2:idBarang,kuantiti,tempoh and status
please help me.....
I try to help but I`m not guru. You can use two SELECT request when you Click on current Button, the first will be something like this:
SELECT * FROM penempahan;
Second request can be:
SELECT * FROM barangTempahan;
You can look and this http://www.w3schools.com/sql/sql_select.asp
still.....i cannot solve my problem.....i dont want to select all the data...i just want to select a few of them only.....i dont know how to select them in .cs because i'm using a gridview......so,i cannot select two tables in one gridview.....
:D:D:D:D You are Lame. Read Read read. http://www.w3schools.com/sql/sql_select.asp
Here you will find how to use SELECT Statements of SQL. It have examples like:
SELECT LastName,FirstName FROM Persons;
Persons - is the table;
LastName and FirstName - is columns in Persons table;
With this Statement you select all data from columns LastName and FirstName.
If you wish to take current data from current column look this and READ http://www.w3schools.com/sql/sql_select.asp
If you don't know how to work with the SQL Classes in .NET Framework Read this: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx, http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx
If all this information isn't help you please define your problem again !!!
1st table empTb>>depno(FK)
2nd table deptTb>>depno(PK)
select e.empId,e.empName,e.depno,d.depName from empTb e,deptTb d