|
There is nothing like nested table in ado.net. But, the solution is there where the relational features of dataset comes in picture.
fetch both the tables separately and add a foreign key relation between them. Then using methods like getchildrows, etc, you can get ur prob solved.
Best Regards,
Darpan Gogia
|
|
|
|
|
Darpan Gogia wrote: There is nothing like nested table in ado.net. But, the solution is there where the relational features of dataset comes in picture.
Isn't that what I suggested?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I thought to clear his basics that dataset doesnt support nested tables
So that he is not another babbage.
Best Regards,
Darpan Gogia
|
|
|
|
|
I have a little problem:
I use ado to connect to a mysql database (version 4.0.12) and mysql odbc driver(3.51).
The system works fine but recently i ran into this problem:
I've installed it on a LAN consisting of 5 win98SE stations making one of them the database server.
The program works on two of them quite ok but fails on the other 3. The thing is that the other 3 computers still connect to the db but some of the querys fail.
Actually is not the querys that fail but rather the call to _RecordsetPtr->GetCollect("field")
To be more precise a query like "SELECT id, name, address FROM clients" works.
A query like "SELECT clients.id AS id, clients.name AS name, ocupations.kind AS kind FROM clients AS clients, ocupations AS ocupations WHERE clients.ocupationid = ocupations.id" fails when i do a call to pRecordSet->GetCollect(L"kind") with invalid pointer.
Another thing to remember is that the database server is installed on one of the computers that do not work. The stations on which the program works connect to this computer via LAN
So, what do i do? Where should i search for the bug? I really have no ideea.
I never had this problem on winxp and this program works on several win88se networks
|
|
|
|
|
Nevermind. It worked after installing MDAC 2.8 sp1.
It didn't work with MDAC 2.8 though..wierd since this is a win98se computer and on winxp i didn't upgrade anything
|
|
|
|
|
Hello,
In SQL Server 7.0, I can easily create tables and import data from other sources such as access. Is it possible to do the same with SQL Express Edition?
Thanks in advance,
Rashar
|
|
|
|
|
If you can export to MSAccess you should then be able import the MSAccess tables to SSE
Pictures of the menu available at the drive-thru
|
|
|
|
|
I think I *may* have found a better way. Go to SSMSE and use the wizard to create a new database and make it sql7.0 compatable. You'll find that choice under the select a page window (click the option page).
HTH.
Pictures of the menu available at the drive-thru
|
|
|
|
|
Hey, Thanks for your replies...
So I take it that I will need to install SSMSE? I don't recall seeing that anywhere after I installed studio 2005? If so, I will download it and run the wizard.
Thanks again,
Rashar
|
|
|
|
|
|
Hi
I have a data in sql table as
EventTypeID Content EventID
1 abc 1
2 gdfg 2
3 fdg 4
4 fgh 54
1 er 54
2 dfg 34
3 fgfdg 34
1 eert 45
2 dfg 4
The result i want is, when i fire a select query , the result should be IN THIS FORMAT like this
EventTypeID Content EventID
1 abc 1
2 gdfg 2
3 fdg 4
4 fgh 54
1 er 54
2 dfg 34
3 fgfdg 34
4 NULL NULL
1 eert 45
2 dfg 4
3 NULL NULL
4 NULL NULL
So which query will do this ?
|
|
|
|
|
Looks like you are missing a column. If you are trying to match sets of EventTypeIDs (1,2,3,4) you need to identify the sets some how. I can't see anything in your data that would indicate a relationship between the sets except order (which is unreliable and not guarenteed).
Go back to take a closer look at your design.
|
|
|
|
|
Select EventTypeID ,Content ,EventID from Tablename
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hi Sandeep,
Your reply is:
Select x.EventTypeId, z.Content, z.EventId from (Select distinct EventTypeId from tbl) x left join tbl z on x.EventTypeId=z.EventTypeId
This way you can get the expected result.
Best Regards,
Darpan Gogia
|
|
|
|
|
We're on the process of shifting from Single to Distributed Database.
We have a program (say Mainprogram) that updates the central database, specifically Table1.
Also, we have many existing little programs (say Subprogram1, Subprogram2, ..etc) that also updates the central database, also the Table1, just like the MainProgram. We need to resolve this in such a way that only one program will update the central database.
It is certain that the Mainprogram will only the one who will update the central database. How will our little programs handle this. These little programs need also to update the Table1 in central database.
Or is this OK? Please help. I dont know anything about DB. Im using Oracle 9+ and VC++ 6.0
|
|
|
|
|
Hi,
I have table like this
Name Age RolNo. Qty
A 1 2 3
B 1 2 3
C 2 4 5
D 2 9 2
E 2 4 1
F 3 3 4
G 4 5 5
H 4 4 4
NOW, I WANT THE FETCH RESULT AS (i,e First row of each group , GroupBy Age)
Name Age RolNo. Qty
A 1 2 3
C 2 4 5
F 3 3 4
G 4 5 5
What query i should write for this. which meets my requirement.
Thanx
sandeep
|
|
|
|
|
SELECT a.Name, a.Age, a.RolNo, a.Qty FROM Table1 AS a, (SELECT MIN(Name) AS MinName FROM Table1 GROUP BY Age) AS b WHERE a.Name=b.MinName
Is that right?
|
|
|
|
|
i face a problem converting varchar to datetime,the date is stored as char(10) and i need to compare it with a time. i use this stored procedure
CREATE PROCEDURE cst
@v datetime AS
select * from col
where CAST ( col AS DATETIME ) < @v
GO
and get this error when run this (exec cst '01/02/2006')
Server: Msg 242, Level 16, State 3, Procedure cst, Line 5
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
|
|
|
|
|
Do you have a table named col in your database that also has a column named col ?
What is the datatype of the col column?
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
EricDV wrote: Do you have a table named col in your database that also has a column named col?
yes i have.
the datatype of the col is char(10).and all its data like '01/02/2006'
what i want is to select recoreds less than eg. '01/01/2006'
|
|
|
|
|
Check your data in the col column.
You will get that error if there is a record that cannot be converted:
ie.
00/00/0000
01/01/0001
00/01/2000
01/00/2000
The error will not happen if all the data is valid.
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
is there any way to tell it the date format because all recored are in correct format . a datetimepicker was used to fill it
|
|
|
|
|
it is a better practice to use Convert instead of Cast
use it as follows
Convert(smalldatetime,'01/02/2006',103)
i think this will do your work
note u can change 103 to whatever format u are using
good luck
dsfds
|
|
|
|
|
Try changing your stored procedure to this:
CREATE PROCEDURE cst
@v datetime
AS
SELECT * FROM col WHERE CASE WHEN ISDATE(col)=1 THEN CAST ( col AS DATETIME ) ELSE @v END < @v
GO
I'm not sure why there is a problem with the CAST, but checking to make sure that the col ISDATE() will most likely avoid the problem. However, records that have a col column are not able to be converted will not be returned.
Does this help?
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
EricDV wrote: CREATE PROCEDURE cst @v datetimeASSELECT * FROM col WHERE CASE WHEN ISDATE(col)=1 THEN CAST ( col AS DATETIME ) ELSE @v END < @vGO
yes it work but i have just discovered that when it casts the it to datetime, it put it in the format mm/dd/yyyy.
is there anyway to let the format dd/mm/yyyy
thanks for your help
|
|
|
|