File based hash data structure [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a requirement to compare a "key" of each records(around 1m records) against 70m+ records in DB.
I really don't want to hit the DB again and again to compare.
when I try to load all the keys (just keys) from DB to in memory (hashTable), I am getting out of memory exceptions randomly on other parts of program (as I expected).
is there any file based implementation of hash table instead of in-memory?

Create a temporary table in the DB and write all the 1m keys to it. Then, use a query to compare the keys in the temp table with the ones in the target table - this will be relatively fast since SQL engines are really good at joining. Since you only need results for 1m keys, the query will return 1m rows(instead of 70m), and you can also stream that result(since it already contains the matches).

Related

How to locally store tabular data [closed]

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.

Digitally sign large XML file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have large XML file to sign. The file size might go up to 4 GB. I am looking for solution where instead of loading whole document in to memory, I can do the signing batch by batch. Like reading few lines from stream and then sign it separately. Then combine all generated hash and compute final hash.
I am not much aware about hashing stuff. IF anybody knows the answer please help me?

How to update SQL Server table rows in different servers using latest technology [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to update daily sales & stock details to my head quarter database every EOD, which was located in different server. How can I achieve it by any latest & efficient technique? My application is a .NET 4.0 web application.
Note: existing technique we follow is manual download/upload concept, hitting HQ database and inserting the data and fetching data from HQ database.
Please advice..
link another server like this
EXEC sp_addlinkedserver
#server=N'S1',
#srvproduct=N'',
#provider=N'SQLNCLI',
#datasrc=N'192.168.0.1\SQLEXPRESS';
then you can use tables from this server like
SELECT * FROM S1.Data_1314.dbo.dev_vr_Details;
INSERT INTO dev_vr_Details SELECT * FROM S1.Data_1314.dbo.dev_vr_Details;
when you finish your work just remove like like
sp_dropserver 'S1', 'droplogins';

Manipulating headerless files containing tables [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have files (like plain text) that I should insert into SQL using C#.
They are headerless, and even without extension. Only info I have is starting index of every column.
Any help how can I do this? Ok, I know I will need to separate columns and insert them in datatable when I read file, but how to read those rows?
You need to read up on SQL Server's bcp.exe utility (bulk copy) and its SQL statement brother bulk insert and their C# sister, SqlBulkCopy.
As far as creating a custom DataTable goes, read the documentation. Don't forget to invoke AcceptChanges() after creating the columns you want, and after adding the data you want to add.

Maintenance Program with a txt file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to write an employee maintenance program (in C#) that can add, change and delete from a text file. I have the HTML all put into an .aspx file but I have NO clue on how to set it up to read from a text file and populate the input fields with the employee to maintain.
If I could get some insight on how to read a text file and populate the input fields(form fields) that would be great. Even a link that explains it since I haven't been able to find one. The text file will have to have a record ID as the first field so I know which one to grab for editing(to display) or deleting.
There's a toolkit of functions to manipulate files in the system.io.file class. That's a reasonable start for the project.
You might also consider using a database instead of a text file. They're designed to handle storage and retrieval of data that changes a lot. A text file is doing it the hard way.

Categories

Resources