Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. I would think you could put them in either General or ASP.NET. In general, webservices are pretty straightforward. If you get into more advanced questions, like how to create a module in between one of the layers, then you could take your pick of forums. -ner
  2. My suggestion wasn't meant to be harsh - just reality. It's generally going to "sink in" better if you write a bit of test code yourself to see what happens. I can almost guarantee that if someone said "no, that's not expected behavior" that you'll move on, but that it will come up again in a few months. If you write the test program (probably 15 - 20 minutes) you'll never forget it. Also, the answer may vary depending on a LOT of factors, none of which you mentioned. For example, how are you connecting to Access, what mode does Access run in, are you relying on the DataAdapter, does the UpdateCommand use a proc (possible in Access) or dynamic SQL or something else, and more. My guess is someone does know the answer to your question, but didn't answer because answering would involve asking some questions to make sure the response was fairly accurate. Otherwise they could just answer "you'll get an exception thrown", but that may not be true in your case... -ner
  3. You probably should wrap the query with IsNull or COALESCE to convert the sum. Something like: select IsNull(sum(unitprice), 0) from [order details] where orderid=999999 You usually only use @@rowcount when performing an UPDATE, INSERT or DELETE to check how many rows were affected. On a SELECT, the @@rowcount is useful, but not so much when doing a SUM or other aggregate function. -ner
  4. I don't believe the current C# Express has support for mobile devices. The technical preview available last summer did show some support though I didn't take a very long look at it. At the time, Visual Studio was pretty unstable so I didn't want to spend too much time in there. From what I remember, a "new project" template showed an image that looked just like a mobile device - looked cool. :) -ner
  5. If you mean the SUM returns more than one, then you need to set a variable and use that. If the SUM returns any number, then @@rowcount will be 1. It might be more than one, if you have a GROUP BY. Remember that @@rowcount is the number of rows returned - in a typical SELECT SUM(...) you're returning one row, one column (the sum) - so @@rowcount will be 1. If the WHERE clause returned no records and the SELECT SUM(...) return NULL, then @@rowcount would be 0. What you probably want is: DECLARE @count int SELECT @count = SUM(...) FROM table1 WHERE... IF @count > 0 BEGIN -- Do something here END -nerseus
  6. Offhand, I wouldn't expect a response since you haven't shown us anything that indicates you've looked for this yourself. Maybe it's just me, but if someone wants help, I want them to first indicate that they've tried everything they can think of first. In your case, you've seen this problem before so you probably have a method to duplicate the issue - get 2 or 3 people on your .NET app at the same time, pressing Enter and see what happens. If it were me, I'd be asking a bunch of questions. When did the VB6 app fail - when opening the connection or during the update? What was the error and what generated it (Access, RDO, etc.)? How do you open your connection and how is Access configured - can you have more than one connection at one time? -ner
  7. Check the help on ToString for dates, mm is miliseconds I think. You want MM instead - it's case sensitive. -ner
  8. Should have added, got an ATI 9800 Pro for $150 (US) after rebates for the birthday. Now I just need some free time. Or a LOT of money so I can retire and spend my "work" time doing hobbies instead :) -ner
  9. I want/need/strongly desire some Free Time. Can Santa extend the day by 2 hours or more? Maybe make me a sane insomniac? That would be like 6-7 hours a day! -ner
  10. You can definitely do C programming with Visual Studio, no question. By default, if your files have a .c extension, VS will assume the file is C and not C++. Here's a link to Microsoft's KB. You can also definitely create and compile unmanaged C++ programs, which is just a "standard" C++ program including access to maloc, pointers, etc. By going unmanaged, you lose access to the .NET framework, garbage collection, etc., but it sounds like you know that and it's not much of a concern. There is one major difference between Visual Studio and Borland's product - one that may make a big difference to you and your company: the compiler. All compilers do NOT create the same code. I have no direct knowledge of the compiler differences, but I hear that the IBM compiler generally creates faster code and that MS is one of the slower ones. I think Norton makes a compiler in addition to Borland. And there's always the free compiler, gcc. As a note, there's nothing stopping you from using Visual Studio for development and have it hook to another company's compiler. I would assume Borland's IDE works the same way. By the same token, if you want to use SourceControl but don't like Visual SourceSafe, Visual Studio allows integration with other source control systems. So, there are lots of options. The good news is that you don't have to go "all Microsoft" just because you like their IDE, if that's the route you take. Good luck and happy hunting :) -ner
  11. If you're trying to find the exception, turn on the catching of all exceptions. (This is from memory): Select Debug->Exceptions Find the ".NET Runtime..." node in the treeview (second down in my list of four items). There should be some radio buttons in a few groups at the bottom. The top group should have something like "Enable" or "Break...". Sheesh, you'd think I'd have this memorized... if you can't find it like this, let me know. This should stop on all .NET exceptions, even if it's in an assembly that you don't have sourcecode to (I've gotten exceptions in System.Data a LOT). In C# Express (I have beta 1, I think), you can use: Debug->Exceptions->Break When an Exception Is Thrown The default behavior of Visual Studio is to not break if an exception is caught. The options above will allow breaking on any exceptions. Another thing to check is what threads are running (another Debug->Other Window kinda toolbar). You might be able to set breakpoints up that way, too. I'm not sure why filling a dataset needs to be so... complicated? But if you really need multiple threads to fill it, better make sure the "base logic" of when each table will get filled is in sync. You probably know that already, but if you have any doubts about the code, I'd run some tests to flesh out any other bugs first. -ner
  12. Since this sounds like a homework assignment... Can you show us what code you've tried? Do you need help looping through the array, finding the max value, or displaying a value (display it *where*)? As you can see, there are many possible questions that need answering... -nerseus
  13. We need to see some code and which line has errors. Don't just show the line that errors out. A not defined error points to some code that once ran that isn't anymore. Maybe you skipped some initialization, maybe you deleted some code, maybe something else. If the project is small enough, zip up the whole thing (minus any EXE or DLL). -ner
  14. Does the listbox have sorting turned on? That might account for its extreme slowness. If you're retrieving from a database, put the "ORDER BY" there and turn sorting off in your listbox/combobox to save time. I can't see any reason to fill a listbox with more than a few dozen entries, maybe a few hundred if really needed. Anything more and you need a different solution. -ner
  15. Maybe just talk to your mum and say "Hey, I want my computer on 24/7 to act as a webserver." Communication is key. -ner
  16. Any other details, such as what you've noticed or how soon the OOM occurs. For example, is it the first time you access the Database or after 30 minutes? If it's the first time, what's the query, XSD, and relevant code look like? Are there "special" features such as non-standard DB drivers, expression columns, etc. -ner
  17. $60 isn't screwed, if you got the silver edition. That's what I paid through Steam. No tax, got it the instant it came out, just like everyone else but no long lines :) Getting OT: HL2 was very good, definitely the best FPS I've played in a long, long time. I thought it was kinda short at about 12-15 hours (wasn't keeping track). Took about a week to get through it, only. -ner
  18. I got Call of Duty for $10. My father in law *almost* got a 17" LCD for $200, normally about $450. -nerseus
  19. Can you show us what code you've used so far? If you have an XmlDocument loaded, use the SelectSingleNode or SelectNodes methods to get to the nodes you want. For example, to get the ip address, use something like this: XmlNode node = xml.SelectSingleNode("/STATUS/SERVERINFO/VARIABLE[@name='ipaddress']/Value"); string ipAddress = node.InnerText; The XPATH string says this, mosly: Find a node/element STATUS Find a node/element SERVERINO under that (must be under it) Find a node/element VARIABLE under that The element VARIABLE must have an attribute named "name" that has the value "ipaddress". The last part of the path, "/Value", is the final node you want to return through SelectSingleNode. From that node, you can get its inner text, the value in your case. -ner
  20. If you want to just trim spaces, why not use the Leave or LostFocus events? Or, if you're binding, use the DataSet's ColumnChanged event or something similar? Maybe when you do EndEdit on the DataRow? Or, if you have a common class to handle Database calls that takes a DataSet, it could generically loop through rows/columns and trim everything that's a string - it's more extreme, but easy to write and use. Another alternative would be trimming in a stored procedure. I wouldn't recommend it as there would be no UI validation and it splits the business rules even more than usual. It has the advantage of knowing that regardless of client side code, the field will always be trimmed before going in the Database. -ner
  21. Unless you must read it one byte at a time, I'd read in the whole string and loop through each char, one at a time. Something like the following: string s = System.IO.File.OpenText("c:\\test.txt").ReadToEnd(); foreach(char ch in s.ToCharArray()) { } -ner
  22. I was just using pseudo-code, to show the general feel for a "3 try, retry" in a function. But maybe is *should* make my own language! John_0025, for what you want I would suggest a little refactoring to make your code more readable. In particular, the use of goto is generally frowned on, mostly because it generally makes code less readable. Suppose you had two functions instead of one: InsertWithUniqueName and CallDB. The call to InsertWithUniqueName could call CallDB and, if it violated the unique constraint, popup the message and call CallDB again. That way you get some reuse out of the "CallDB" function and you keep the retry code in a different function. For very small functions, you could argue that a label and goto do not make the code less readable, but there's almost always a *more* readable way to write the code that would not use the label and goto. Anything that's more readable is definitely going to be better in the end, especially when you have to go back and touch that code in 6 months. -nerseus
  23. I've never seen what you describe. Where exactly is the inconsistency? Is it that on some calls to ProcA, columnB isn't returned and sometimes it is? Or is it more that ProcA returns a column while ProcB doesn't - even though it's in the SELECT? How are you checking that the column is or is not being returned? If you use XML, such as GetData, keep in mind that a column will not show in the XML if its value is NULL (database null, not .NET). For example, if you have only a first and last name but not a middle name, the XML might look like: <Table1> <FirstName>Bob</FirstName> <LastName>Smith</LastName> </Table1> You won't see "<MiddleName></MiddleName>" as that would indicate that the middle name exists, but is an empty string. The lack of the element is how the XML represents null. -ner
  24. I've found that many games will install just fine off the hard drive, given that the original Disk 1 is in the drive. For example, I've copied 2+ disks to my hard drive and installed from there. For most games, copying all to one folder works fine. In some cases, I've copied to a "disk1", "disk2" folder, etc. In a couple of cases the install managed to find them automatically, in others it said "couldn't find disk" but allowed me to pick the file manually during install. For about $0.20 you can copy each to a CD. The bigger issue I have is storing all the copies. I've finally gotten around to backing up about 10-20 music CDs as I'm starting to get more and more skips on the originals. Sure, it's only 4 or 5 minutes to burn a CD - but I hate doing it. In the end, I'd rather have my backup go bad and 4 or 5 minutes isn't that bad. Better than the "old days" of backing up my hard drive to 55 floppy disks. Or worse, restoring from 55 floppy disks. -Ner
  25. Just trap the doubleclick event and put your code in there instead of in the click event. -ner
×
×
  • Create New...