|
A lot depends on what you are going to do with the data.
If you are going to be reading, inserting, updating and deleting then a database is the way to go - SQLite is a good choice.
If all you need to do is read a large amount of data into an application and never need to update this data then you could consider Serialising your classes(or collections of classes). This is what I have done for a calorie counting application and a visual screening application that I wrote(even if you are applying updates serialisation is still worth considering).
The nice bit about serialisation into XML is that you can look at your data with something like Notepad++ and make changes manually where necessary.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Ilove XML, but 300'000 rows, in a single file, times out the application
|
|
|
|
|
Sure 300,000 rows is probably going to stretch things a bit.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I suggest System.Data.SQLite: Downloads Page[^]. It is up to date, easy to use from c#, there is no service needed and it has very fast inserts and retrievals into/from tables. Last August I tested it by inserting up to 100 million of simple unique records on a Win 7 Pro with 4 GB of RAM and I could retrieve data in milliseconds, even from a table of 100 million... which I found quite impressive. When inserting I used parametrized queries. For fast retrieval an index needs to be created on a table column using SQL. Of course it depends on how complex is your data.
I hope this helps...
|
|
|
|
|
SQL Server has a localdb version which seems to be the replacement for the compact edition.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Hi,
I trying to learn cubes and deploy to analysis services.
I am using sql server express with advance tools, but i can not deploy the cube.
Please can some one assist me.
Thanks,
|
|
|
|
|
|
The concept:
An Information System is a system, automated or manual, that include people, machines and/or organized methods for collect, process, transmit data that represent information.
(It is my translation from Spanish to English -with a little help of google translator-).
I will like to know if I understand well the concept. I'm going to type a real example:
Hairdresser appointment:
To take an appointment there, you have to go to the hairdresser and say it to the haircutter. Then he write in his diary (physical) the date.
NOTE: there are not any technologies, all is MANUAL.
QUESTIONS: Is it an Information System?
I think that could be, because include an elements set (people -customer and haircutter- and organized methods -diary-) for collect, process, transmit data that represent information (the haircutter COLLECT the customer's date in his diary, he check if the date is unoccupied -PROCESS- and finally he TRANSMIT THE DATA that represent information to the customer, for example "Ok, remember you have appointment to the hairdresser X date").
Am I understanding well the concept?
|
|
|
|
|
|
Thank you for your answer Richard MacCutchan. I have my own notes about Information System concept (I wrote it from there), I invented a case study related to the concept, to know if I understand well the concept or not.
|
|
|
|
|
Hi all.
I Have a SQL server 2008 DB.I also have some Oracle Database.Now I Want to get data from Oracle DB to SQL server DB.
I also read some post about link server but I still not success connecting to Oracle DB.
For example some information about oracle DB that I can connect by using SQL developer
IP:10.149.35.132
Username:abc
pass:bcd.
Instance:bms
|
|
|
|
|
Instead of posting your connection information try letting us know how you tried to connect and what went wrong
|
|
|
|
|
Thanks for your reply.
I Have try some action to add linked server to Oracle DB but I failed.If anybody have done please help me.
Chat with me and i will give you Teamviewer ID to see.
Thanks.
|
|
|
|
|
THe error here
The linked server has been created but failed a connection test. Do you want to keep the linked server?
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
SQL Server Network Interfaces: Connection string is not valid [87].
OLE DB provider "SQLNCLI10" for linked server "BIM" returned message "Login timeout expired".
OLE DB provider "SQLNCLI10" for linked server "BIM" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.". (Microsoft SQL Server, Error: 87)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1617&EvtSrc=MSSQLServer&EvtID=87&LinkId=20476
|
|
|
|
|
You've provided the wrong credentials to connect
|
|
|
|
|
I can connect to Oracle now.The first Oracle DB is OK, but now I want to connect to two or more oracle at the same time.
The second ORalce is fail.
|
|
|
|
|
|
I Can connect to one OracleDB now.Tomorrow I Will try the link you post and connect to the second Oracle DB and report here.Thanks for your help.
|
|
|
|
|
The tnsnames.ora is here
PMCalculate =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.138)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = NMS)
)
)
BIM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.12)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = nms)
)
)
BIM is OK, PMCalculate is fail
Do I need to restart something each time I add a DB to tnsnames.ora
|
|
|
|
|
I didn't think you had to do a restart each time, but it might be worth trying.
But first, if you take BIM out of the .ORA does PMCalculate still fail?
I notice SERVICE_NAME is in capitals for PMCalculate but lower-case for BIM ... is there a case-sensitivity issue here?
Are you sure that the Oracle Server on Host 192.168.2.138 is listening on the default port (1521)? (Reference in case you need to check ... Managing Oracle Database Port Numbers[^])
Beyond that I'm running out of ideas, sorry.
|
|
|
|
|
Thanks you.
The other is not Service Name, SID.
Everything is ok now.
|
|
|
|
|
Hi All,
I have two tables 1st table is Employee (Id, Name, Level) another one is EmployeeRelationShip (Id, EmployeeId, ManagerId), in Employee table all level 1's are Managers and Level 2's are workers.
In EmployeeRelationShip table all Employees would have their ManagerId as Manager's Employee Id. Now for this structure I want to Order by Name for all managers, again under each manager I want to order all his Employees order by name again?
Can anybody please help me in writing a script for me for this scenario? Any help may be a code snippet or a link or even a suggestion would be much helpful. Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Let us assume that you have following data in Employee table
Id Name Level
1 zzzz 1
2 nnnn 1
3 dddd 1
4 df 2
5 bc 2
6 za 2
7 az 2
8 ff 2
9 ef 2
and these data in EmployeeRelationShip table
Id EmployeeId ManagerId
1 4 1
2 5 1
3 6 2
4 7 2
5 8 3
6 9 3
This query will give results ordered by Manager Name and then by Employee Name:
select e.Name as ManagerName, b.Name as EmpName from
EmployeeRelationShip r inner join
Employee e on e.Id = r.ManagerId
inner join Employee b on b.Id = r.EmployeeId
order by e.Name, b.Name
And the output will be:
ManagerName EmpName
dddd ff
dddd ef
nnnn za
nnnn az
zzzz df
zzzz bc
Hope this provides an idea for you to solve your problem.
|
|
|
|
|
OP asked for Quote: I want to Order by Name for all managers, again under each manager I want to order all his Employees order by name again?
Your query is only listing the workers
|
|
|
|
|
You can use a recursive CTE to traverse the employee hierarchy - there a good example on the MSDN site - Recursive Queries Using Common Table Expressions[^]
Yours is a little more complicated because you have the extra table, which could have been replaced by a single column on the Employee table "ReportsTo". It is also a little more complicated because you want the Managers in Name order followed by the Employees (for each Manager) also in Name order.
This query seems to do what you want (I've used the sample data provided in the earlier response)
;WITH emps AS
(
SELECT e.Id, e.[Name], e.[Level], er.ManagerId as ReportsTo, em.Name as ManagerName
FROM Employee e
left outer join employeeRelationship er on er.EmployeeId = e.id
left outer join employee em on er.ManagerId = em.id
), Emp_CTE AS (
SELECT Id, [Name], [Level], ReportsTo,
MtoE = CAST(CAST(isnull(ManagerName,'') AS CHAR(30)) + '/' + CAST([Name] AS CHAR(30)) AS VARCHAR(MAX))
FROM emps e
WHERE ReportsTo IS NULL
UNION ALL
SELECT e.Id, e.[Name], e.[Level], e.Id as ReportsTo,
MtoE = MtoE + '/' + CAST(e.[Name] AS CHAR(30))
FROM emps e
INNER JOIN Emp_CTE ecte ON ecte.Id = e.ReportsTo
)
SELECT Id, [Name], [Level]
FROM Emp_CTE
order by MtoE
Giving the results you asked for:
Id Name Level
3 dddd 1
9 ef 2
8 ff 2
2 nnnn 1
7 az 2
6 za 2
1 zzzz 1
5 bc 2
4 df 2
The explanation:
The first CTE emps is just to simplify the table structure as I can't use a left outer join in the recursive CTE that follows it. If you run that query by itself you get the following
Id Name Level ReportTo ManagerName
1 zzzz 1 NULL NULL
2 nnnn 1 NULL NULL
3 dddd 1 NULL NULL
4 df 2 1 zzzz
5 bc 2 1 zzzz
6 za 2 2 nnnn
7 az 2 2 nnnn
8 ff 2 3 dddd
9 ef 2 3 dddd
The second CTE Emp_CTE is a recursive query that first gets only the Managers (marked as the "Anchor member" in the comment in the code). Those results are then fed into the "Recursive member" of the CTE until all of the employees have been processed.
The "clever" bit is the derived column MtoE that "tracks" the levels of recursion, capturing first the Manager's name and then the Workers' name. I've cast the individual names to CHAR(30) to ensure that the subsequent ORDER BY works properly - i.e. making sure all of the names are the same length, padded by spaces if necessary. You might need to change the 30 to a larger number if you have some long names. Also note in the Anchor member I've cast the combination of names to be a VARCHAR as the column grows in length the further down the recursion you have to go (e.g. if there was a level 3 employee).
The very last bit just captures the data from Emp_CTE and ORDERs it BY the derived column so the output appears in name order.
|
|
|
|