• What are you working on? v19
    6,590 replies, posted
SORRY WRONG THREAD
[QUOTE=Dr Magnusson;30940136]Yeah, FP Programmers, hit it up on Steam.[/QUOTE] I was in this but someone kicked me out
Is there some magical C#/.NET construct that will allow me to use an sql server without actually writing any sql? Like, connect to server, get table as some sort of dictionary or something, maybe indexed by primary id, then modify table and give back and it uploads to the sql server, without me having to write it?
[QUOTE=bobthe2lol;30943198]Is there some magical C#/.NET construct that will allow me to use an sql server without actually writing any sql? Like, connect to server, get table as some sort of dictionary or something, maybe indexed by primary id, then modify table and give back and it uploads to the sql server, without me having to write it?[/QUOTE] Actually yes. It's called "LINQ". Therers a ton of tutorials about it...
[QUOTE=bobthe2lol;30943198]Is there some magical C#/.NET construct that will allow me to use an sql server without actually writing any sql? Like, connect to server, get table as some sort of dictionary or something, maybe indexed by primary id, then modify table and give back and it uploads to the sql server, without me having to write it?[/QUOTE] Here's a good VB.NET tutorial for something similar to what you're asking for: [url]http://www.youtube.com/watch?v=tec_XE1Pdss[/url]
So I've been trying to learn C# lately using the book [url="http://oreilly.com/catalog/9780596514822"]Head First C#[/url]. But it just feel like it's moving forward far to slow.. The thing is that I know quite a bit off C++, which I learned mostly by reading the book [url="http://www.amazon.co.uk/Accelerated-Practical-Programming-Example-Depth/dp/020170353X"]Accelerated C++[/url]. Which is an excellent book by the way. I want a learning resource that demostrates good C# code and usage of .NET. I would prefer an online resource but I suppose if there are any GREAT books you can recommend that is fine aswell.
An entire day. With no internet. :tinfoil: Result: Networked Rock Paper Scissors! [editline]6th July 2011[/editline] I was so sad though having no internet, so i played and played by myself. Also its in console form since open.gl dont get me started and took me 2 hours. :( edit: Automerge is broken isnt it
This new post thing is really annoying. Screw this, I'm using pastebin. Now, back to what I was going to say: [URL="http://pastebin.com/zX5FsiZB"]http://pastebin.com/zX5FsiZB [/URL]That... sort of worked. Hm.
I've got a SQL table with lots of results, which I'm querying to get them all for a particular ID I want to be able to access these results individually fairly quickly - what's the best practice for doing this? through SQL or some data structure which I can search through? Which is fastest?
SELECT * FROM table WHERE id=5 then loop through them? I'm not really understanding your question
[QUOTE=TehWhale;30947014]SELECT * FROM table WHERE id=5 then loop through them? I'm not really understanding your question[/QUOTE] He means what would be faster, keeping it as SQL or saving it in a dictionary
[QUOTE=TehWhale;30947014]SELECT * FROM table WHERE id=5 then loop through them? I'm not really understanding your question[/QUOTE] lol I know how to use SQL : ) Is it faster to have the class call the database each time, or a dictionary or list or whatever of the class with all the results I want I don't know what the IDs will be before hand - they are comping from a user-designed template
[QUOTE=bobthe2lol;30943198]Is there some magical C#/.NET construct that will allow me to use an sql server without actually writing any sql? Like, connect to server, get table as some sort of dictionary or something, maybe indexed by primary id, then modify table and give back and it uploads to the sql server, without me having to write it?[/QUOTE] LINQ to SQL will do this I'm sure, but you might want to look up "C# ORM" in google to see some other options...
I've done it with a list just now and that seems pretty quick pulling 12 random items out of ~16,500 rows
[QUOTE=CarlBooth;30947305]lol I know how to use SQL : ) Is it faster to have the class call the database each time, or a dictionary or list or whatever of the class with all the results I want I don't know what the IDs will be before hand - they are comping from a user-designed template[/QUOTE] Dictionary.
Whoops, I could have sworn this was WAYO in Web Development (@CarlBooth)
I seem to spend my whole life using SQL of some description In addition to the 4 or 5 projects I'm doing at work which all use MySQL, our MIS system runs on MSSQL and I also maintain a SharePoint farm running on MSSQL too. :frown:
[QUOTE=CarlBooth;30947846]I seem to spend my whole life using SQL of some description In addition to the 4 or 5 projects I'm doing at work which all use MySQL, our MIS system runs on MSSQL and I also maintain a SharePoint farm running on MSSQL too. :frown:[/QUOTE] Out of interest, which of the crappy MIS systems do you use?
[QUOTE=Wickedgenius;30949994]Out of interest, which of the crappy MIS systems do you use?[/QUOTE] SIMS Only the UI is crappy, the actual back end is built like a brick shit house and is amazingly robust and secure [editline]6th July 2011[/editline] Oh Shiit - I thought 3 seconds was slow for 16k rows, but it turns out there are over 350k rows That's actually not that bad then [editline]6th July 2011[/editline] ha, the table has 7 fields, all TEXT, and it's 23MB
Damn. There seem to be no way to persist a CookieCollection across multiple program launches. It doesn't seem to be serializable, and I can't really get any actually file-writable data out of it...
[QUOTE=CarlBooth;30950533]SIMS Only the UI is crappy, the actual back end is built like a brick shit house and is amazingly robust and secure [/QUOTE] We also use SIMS although my only real experience is when it goes wrong, I'm the one who has to run around when an update doesn't work quite right, our Network Manager tends to put updates off because they tend to break stuff, although the backend itself I will agree never seems to go wrong.
[QUOTE=Wickedgenius;30950761]We also use SIMS although my only real experience is when it goes wrong, I'm the one who has to run around when an update doesn't work quite right, our Network Manager tends to put updates off because they tend to break stuff, although the backend itself I will agree never seems to go wrong.[/QUOTE] Protip: In group policy give your staff group Full Control permissions on the SIMS .net folder in program files Then your upgrades will go smooth as a baby's ass [editline]6th July 2011[/editline] Also, always wait 2 weeks before applying any upgrades 90% of the time they re-release it cos it breaks some 3rd party program
[QUOTE=CarlBooth;30950811]Protip: In group policy give your staff group Full Control permissions on the SIMS .net folder in program files Then your upgrades will go smooth as a baby's ass [editline]6th July 2011[/editline] Also, always wait 2 weeks before applying any upgrades 90% of the time they re-release it cos it breaks some 3rd party program[/QUOTE] Many thanks, we do tend to leave upgrades anyway but our NM goes over the top and leaves them sor like a month. The only thing I'm interested in now is if there is a way to talk to the database using C# which won't break it either, have a couple of pieces of software where that would be handy.
Wooo, finished the largest part of my summer work, back to full-time programming. Before I start on the Raknet tutorials, I'm setting up a command system for the console with function pointers and vectors!
[QUOTE=Wickedgenius;30951026]Many thanks, we do tend to leave upgrades anyway but our NM goes over the top and leaves them sor like a month. The only thing I'm interested in now is if there is a way to talk to the database using C# which won't break it either, have a couple of pieces of software where that would be handy.[/QUOTE] In the SIMS directory there's commandreporter.exe which is a CLI for dumping results of SIMS Reports to XML or CSV. This is probably your best bet - just set it as a scheduled task then deal with the output file however you want. The instructions for using it are on Capita SupportNet, but I can't remeber the KB. If you just run it, it will tell you all the switches. If you want to actually write back to the database you need to use their business objects, but you have to sign an NDA. Get your NM to get in touch with Capita about that.
[QUOTE=bobthe2lol;30950745]Damn. There seem to be no way to persist a CookieCollection across multiple program launches. It doesn't seem to be serializable, and I can't really get any actually file-writable data out of it...[/QUOTE] Assuming you are talking about the .NET cookie collection: [URL]http://msdn.microsoft.com/en-us/library/system.net.cookiecollection(v=VS.100).aspx#Y100[/URL] the "[SerializableAttribute]" rather disagrees with you. Any of the methods here: [URL]http://msdn.microsoft.com/en-us/library/7ay27kt9(v=VS.100).aspx[/URL] would be fine for dumping it to a file.
[QUOTE=CarlBooth;30951180]In the SIMS directory there's commandreporter.exe which is a CLI for dumping results of SIMS Reports to XML or CSV. This is probably your best bet - just set it as a scheduled task then deal with the output file however you want. The instructions for using it are on Capita SupportNet, but I can't remeber the KB. If you just run it, it will tell you all the switches. If you want to actually write back to the database you need to use their business objects, but you have to sign an NDA. Get your NM to get in touch with Capita about that.[/QUOTE] That helps a lot, at present I'm opening SIMS and running a report to get the attendance of students for a draw that we do and outputting it to an XML file, I'll take a look at commandreporter though as then I can automate that little bit more of it, will mean I can do some proper work on fridays for once. Thanks Carl, that has helped a lot. :)
[QUOTE=Wickedgenius;30951273]That helps a lot, at present I'm opening SIMS and running a report to get the attendance of students for a draw that we do and outputting it to an XML file, I'll take a look at commandreporter though as then I can automate that little bit more of it, will mean I can do some proper work on fridays for once. Thanks Carl, that has helped a lot. :)[/QUOTE] No worries : ) Before I got the BOs I used to have a batch file to dump stuff to CSV, then import it in to MySQL using LOAD LOCAL
[QUOTE=TheBoff;30951257]Assuming you are talking about the .NET cookie collection: [URL]http://msdn.microsoft.com/en-us/library/system.net.cookiecollection(v=VS.100).aspx#Y100[/URL] the "[SerializableAttribute]" rather disagrees with you. Any of the methods here: [URL]http://msdn.microsoft.com/en-us/library/7ay27kt9(v=VS.100).aspx[/URL] would be fine for dumping it to a file.[/QUOTE] Wait... how the hell did I miss that? I swear I looked at that page... Thanks though :v:
been a while, but I am playing with rotating bezier curves. [IMG]http://f.anyhub.net/3r8z[/IMG]
Sorry, you need to Log In to post a reply to this thread.