|
Thanks. It makes sense, but without any clear documentation that I could find I was unsure.
only two letters away from being an asset
|
|
|
|
|
Yeah, I had to dig for a while to find it. It just didn't feel right saying that it included the log file when it's possible for a log file to be huge compared to the size of the data. So, I had to hunt for it.
|
|
|
|
|
Hi ,
running the query ,say, strQuery , in a query analyzer generates results returning rows ...but folowing code does'nt make it the same ...
strQuery = " some query which works in query analyzer";
DataSet ds = new DataSet();
SqlDataAdapter adapter = new SqlDataAadapter(strQuery,connetion);
ds.tables.add("tablename");
adapter.fill(ds,"tablename"); //it takes 10 seconds at min
....
...
...
int nRows = ds.Tables[0].Rows.Count; // nRows is always 0 showing no record
any help ,,,,,
-- modified at 7:42 Monday 14th May, 2007
Madni
|
|
|
|
|
You need to set selectcommand for SqlDataAadapter
|
|
|
|
|
I set this property with the SqlCommand instance ... didnt work either
Madni
|
|
|
|
|
Can you post the code snippet how you do it?
|
|
|
|
|
this is almost the same as posted ,.... infact my development machine doesnt support the internet facility ... it will be hard for me to do that ... should i have to add the columns as well in datatable before adding it to dataset ,,,.... ???
Madni
|
|
|
|
|
fulbright wrote: SqlDataAdapter adapter = new SqlDataAadapter(ds,connetion);
replace above line with
SqlDataAdapter adapter = new SqlDataAadapter(strQuery,connetion);
|
|
|
|
|
sorry for the mistake .... this is already like that ...
I need to edit my post ,... .thanks for the correction any ways ,,,
Madni
|
|
|
|
|
in that casr check you mapping table may be its not mapped properly.
Try once like this
adapter.Fill(ds);
and access like this
ds.Tables[0].Rows[0]["Col"]
|
|
|
|
|
im a begginer,i have 3 different tables [customer,invoice,projects]
Customer table
intcid[PK]
Companyname
ProjectTable
intprojectId[PK],
intCid[FK],
strName ,
startdate,
Invoice Table
intinvoiceId[PK]
intCid[FK]
intProjectId[FK]
monTotal
i want to select these tables based on the Project name i give..
if the project doesnt have invoice also i have show the output as null in the corresponing row.
i given this query
SELECT
c.intCid,
c.strCompany_name,
p.intProjId,
p.strName,
p.dteStartDate,
p.dteFinalEndDate,
p.strDescription,
i.monTotalamount,
i.intInvoiceId
FROM Invoice i,Customers c,Projects p
WHERE p.intProjId=i.intProjectId
and p.intCid=c.intCid
and p.intProjId=@intProjId
but it givs the value only if the project has invoice record.
can any one help me??
|
|
|
|
|
use following query
SELECT
c.intCid,
c.strCompany_name,
p.intProjId,
p.strName,
p.dteStartDate,
p.dteFinalEndDate,
p.strDescription,
i.monTotalamount,
i.intInvoiceId
FROM Invoice i
LEFT OUTER JOIN Projects p ON p.intProjId=i.intProjectId and p.intProjId=@intProjId
LEFT OUTER JOIN Customers c ON p.intCid=c.intCid
|
|
|
|
|
thanks for the reply...but its not working....
getting all value null..
|
|
|
|
|
i think Projects is your main table .NP run following
SELECT
c.intCid,
c.strCompany_name,
p.intProjId,
p.strName,
p.dteStartDate,
p.dteFinalEndDate,
p.strDescription,
i.monTotalamount,
i.intInvoiceId
FROM Projects p LEFT OUTER JOIN Invoice i
ON p.intProjId=i.intProjectId LEFT OUTER JOIN Customers c ON p.intCid=c.intCid
WHERE p.intProjId=@intProjId
|
|
|
|
|
thank you very much its working properly.....
|
|
|
|
|
hi all
i'm trying to create a table column with the data type Bool using SQL Server 2000, but it gives me the error that it doesn't recognize Bool
what can i do about it, and where can i find the bool data type??
awaiting all replies
Regards
Saira
|
|
|
|
|
|
Hello,
I have a problem with my project. This Project is written by C#.It accesses SQL Server 2005 via Webservice & Seasar.
On the webvervice, I include some package that was built to DLL. Those package retrieve their database.
When I run my project. I must update their database the first. Then, update my project's database.
But i cannot settup the transaction for them.
I wannt to rollback th updated data on their database if updating on my project's database is failt.
|
|
|
|
|
I have two tables. I want to join primary key of the first table with foreignkey of the second table(one-many).How can I do this
|
|
|
|
|
|
Giorgi Dalakishvili wrote: http://www.1keydata.com/sql/sqljoins.html
A good link, something worthwhile for me to bookmark
|
|
|
|
|
Yes the whole website gives quite full information about sql basics
|
|
|
|
|
|
Yes, that is useful website too
|
|
|
|
|