Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
This post was edited and submitted for review 8 months ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
Is there a method to use an XML file instead of a database in the Entity Framework?
Entity Framework itself is provider-based, and is designed to operate over a relational database. If you really wanted to, you could write your own provider for EF that reads from/writes to an xml file, but it would be a huge amount of work.
I expect you should really be looking at one of:
LINQ-to-XML
XML (de)serialization
XPath/XQuery
XSLT
Entity Framework doesn't have a natural fit in this scenario.
Linq to XML isn't all that much actually. I'd go with a serializable solution instead.
I like LINQ to XSD: http://linqtoxsd.codeplex.com/
It is basically LINQ to XML with some classes derived from the XSD to ensure it fits the schema...
I don't think that's really possible.
From MSDN (emphasis mine):
The ADO.NET Entity Framework is designed to enable developers to create data access applications by programming against a conceptual application model instead of programming directly against a relational storage schema.
You can use an oledb connection together with a FORXML command... but you will not have all functionality that is available with other providers...
Is the problem that you need a file-based data store? If so, you could use a SimpleDB data provider. SimpleDB is great if you need a relational database in a single file. MS Access is great for this as well.
XML is designed for communication. If used for storage, it is incredibly inefficient. It might be best to break the two tasks apart and store your data in a relational database and then generate your XML from your data.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
In my .net/c# application on windows desktop i need to locally store some statistics about the users behaviour.
This data should be read again the next time the application is running.
To simply explain the kind of data: it is basically key-value pairs.
I could use something like sqlite but i can imagine there is already something for this premade in .NET?
It comes down to what you want to store - for simple data objects you may use XmlSerialization that can be stored into IsolatedStorage area, specific to appdomain, or userlevel.
for more details: http://msdn.microsoft.com/en-us/library/cc221360%28v=vs.95%29.aspx
If it is relational then Sqlite is your option as well.
So the million dollar question is - what are you planning to store?
You can serialize the state using a binary file or even JSON
Not sure, what you want to achieve. Just keep the data? Or somehow access/process it? What you do with your data determines the data structure.
Among the others, you could put the items to array or List and access them with LINQ. Or you could use ADO.NET DataSet/DataTable, even without database behind it.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
We're going to start writing C# programs against a old legacy database from the early 1980s. There is no support for SQL or relationships, and communication with it is through Telnet commands.
I'm thinking of using some sort of ORM framework, or write my own. My question is if there is any good framework that is possible to easily adapt to these special conditions?
I want to be able to map the classes in my program against tables in the database and work with the database in a modern way, without having to think about the complex telnet commands and the translation of the returned information into something meaningful.
I find it hard to believe that such datasources have any usable adapters today. Think of what kind of operations you will need and construct an ORM with any commands you may require. Depending on structure and data this may vary in a lot of different ways. Some questions you may take along in this project are
Can we standardize CRUD operations or do we have to build a DTO api
Shall we be able to handle any binary data
What pattern shall we use in our C# code and will C# suffice
When it comes to DTO-Api's I like to implement CQRS (Command Query Responsibility Segregation, read this http://msdn.microsoft.com/en-us/library/jj591573.aspx). If you are constructing an ordinary CRUD-Api you will most likely have to separate your code differently and resolve each command type dynamically (if possible).
Feel free to e-mail me, you should be able to reach me in the corp-ad.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
What is the best way to store data & fastest way to access it, that is free and doesn't require additional stuff to install ?
Use sqlite.
XML. Look here. Keep in mind that by using XML, you have a machine-structured human-readable file.
Update
Since this apparently looks very new to OP, here are some links:
About XML:
XML Very Basics
About Accessing XML from C#.NET
Microsoft Linq TO XML Doc/Howto
A nice Linq to XML Tutorial
Well if the language is C, you could use structs and fread() & fwrite() to save the data into single "database" file. It is not the most compatible way but it certainly is fast. And it doesn't require any additional stuff to be installed.
StreamReader to read files
http://msdn.microsoft.com/en-us/library/system.io.streamreader.aspx
and
StreamWriter to write files
http://msdn.microsoft.com/en-us/library/system.io.streamwriter.aspx
They are both classes included in the .NET framework.
I would suggest SQL Server Compact Edition - it's free, file based, requires no extra installation and this also gives you a nice upgrade path since it also supports Entity Framework.
If you need a relational database, use the System.Data.Sqlite ADO.Net wrapper around the Sqlite database. Drop the DLL into your project and you get a free, fast, single-file SQL database.
If all you need is a key-value store, then use Persistent Dictionary in the ESENT managed interface.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
We are developing a custom .NET directory listing style application for a client and we require a powerful search solution. The application will be built in ASP .NET C# on SQL Server 08. The application is based around data which users to the organisation can enter in a profile management style area. Fields can be textboxes, textareas, selection boxes, multiselects etc. A user from the main website needs to be able to use the search function to find a result, but this result should search the entire database and not only base the results on one or two fields. It could be anything within any of the fields the user can fill out or select etc.
Can anyone help me find a possible solution for a .NET powered search engine we can use for this application? It must be preferably C#, running on .NET 3.5 and SQL Server 08. The database is a completely custom built schema and so there is no schema example to show or that can be shown.
If you need more information to provide a satisfactory answer let me know and I'll try to provide some more information specific to what you ask.
Thanks, Cian
Checkout Lucene.Net.
Lucene.Net is a source code, class-per-class, API-per-API and algorithmatic port of the Java Lucene search engine to the C# and .NET platform utilizing Microsoft .NET Framework.
You might want to check out Lucerne.NET, which is the search solution used by StackOverflow
In addition to Lucene .NET (which I've used and is very good), you could also consider SQL Server's Full-text search. This is also very powerful and if all the data you need to query is in the database is another good option for you - we used it for a large enterprise management system and it worked well for us.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Is there any open source software for converting SQL statements to LINQ?
You cannot convert SQL statements to LINQ queries without having an object model. LINQ queries objects, while SQL queries relational data, so a mapping is necessary between the two worlds.
Take a look at T4Toolbox - an open source tool on CodePlex that can generate SQL schemas from LINQ and LINQ schema from SQL. Maybe it won't fulfill 100% of your needs, but it's open sourced and therefore extendable.
There is no open source product, but there is an inexpensive commercial product that will do this. The product is named Linqer. It runs about $60. It has worked very well for us. It's been able to convert almost any type of SQL statement to a Linq query.