Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
Is expenseAmount a numeric field, like int, decimal, etc? It sounds like it's a String field. This would make sense since you're loading a DataSet from an XML file. If your XML doesn't contain a schema which defines each column's datatype, everything is assumed to be string. Where is the XML file coming from? If you're creating it, you could add a schema to it to define the table definition (each column with a datatype). Otherwise you'll have to conver the column to a numeric type. Not sure if you can do that directly; you may have to create a new column dynamically, set its type to decimal and set the expression property to something like "CONVERT(expenseAmount, decimal)". This may not be the correct syntax for the CONVERT function - check the help file. Then you can run compute on the expression column which will be type decimal. -Nerseus
-
I'd recommend any DirectX for beginner book. They're all for C++ except two or three (for Visual Basic). Coming out in a few months will be books on DirectX9, but none have been released yet. If you don't know C++, I'd recommend a book that teaches the basics of programming C++ first, before the DirectX book. There used to be free, full versions of older books including some on C++ at informit.com. If not, your local library will have C++ books you can check out for free. If you want to dive right in, head over to http://www.gamedev.net and click their "Articles and Resources" link at the top. For information on different languages libraries (DirectX vs. OpenGL) and more, click the "For Beginners" link at the top. -Nerseus
-
When you setup your PresentParameters, just set the DeviceWindow to the PictureBox control. Also, for obvious reasons, choose Windowed mode :) -Nerseus
-
DX9 (the only officially supported version of DirectX that works with .NET) has a project template that will create a Direct3D project that writes to a picturebox control. When you select new project, select the DirectX project type. A wizard will come up asking for some parameters. I think it's the "Project Settings" page of the wizard that allows you to select a PictureBox. -Ner
-
Most importantly, DX9 is made for managed code while DX7 and DX8 are not. I have some samples in DX8 that work quite well, but MUCH better and easier in DX9. -Ner
-
Well if all the examples you are finding and all of the books are all showing MSDE, then why not go that route? Sometimes there is no perfectly "right" answer. If you're just starting out on something, your best bet is to learn the basics (how to make a connection, right SQL, retrieve and save data) and worry about the database part later. Note that I wouldn't suggest this for a "real" project. But that's what prototypes are for - to figure out what works and what doesn't, especially when picking up something new (like .NET or Database access). -Nerseus
-
They are useful in some situations, but I haven't had the need for one in years. When I did (in VB6), I used an "If...Then" as VolteFace showed in his first example. You're right, it's a shame they didn't include something seemingly so simple in VB.NET. But then, C# and VB.NET are different languages... -Nerseus
-
Whether WinForms or WebForms is easier is mostly preference and current knowledge. It sounds like you might already know web programming (ASP or just HTML) so you might start with that. It sounds like you've given it a lot of thought and WebForms will work for you. Whether it's the best choice or not, none of us here can tell you that. The best we can do is tell you some general pros/cons for each choice. Good Luck :) -Nerseus
-
For a very simple way to play sounds, look for PlaySound (an API call) as well. -Ner
-
What kind of message are you wanting to send? A "chat" type message (custom) or a specific message to a specific server? -Nerseus
-
Are you using anything beside English (US)? I saw a post on Microsoft's newsgroup that may help. Here's the relevent snippet: If you look in your install directory, far enough down, you'll see the "1033" directories (or whatever number they are for you). -Nerseus
-
Also, a Panel supports automatic scrollbars. Draw a textbox really wide, say 200 pixels. Now draw a Panel, say 100 pixels wide. Drop the textbox into the Panel and turn on the AutoScroll properties. You'll see the Panel control can automatically add scrollbars and make them the right size to fit all your controls. I would not recommend doing this except in rare cases. It's not a very standard look, but can be handy if used properly. -Ner
-
A big advantage to WinForms is the rich client experience. Meaning, nice grids (hierarchical, editable, etc.). To get the same thing in a browser requires IE or a high version of netscape (which still doesn't support everything IE does). The deployment problems have been greatly reduced for most WinForms apps. You should check out some of the deployment samples to see what I mean (auto-updating client DLLs for instance). To create a (very simple) setup in .NET for WinForms merely requires creating a setup project. Hooking to a printer in WinForms may be more complicated than the browser version, but I've run into *many* problems printing from a browser. Try telling a client that they must change their user's browser print setting just to turn on/off certain header/footer styles. And your HTML table's nice background colors for column headers and such don't print without going to the Advanced tab of IE's Tools. I'm not trying to point you one way or another. Only by knowing what both WinForms and WebForms has to offer can you make the right choice. There certainly isn't one choice that will work for all apps. -nerseus
-
You can issue commands to FTP servers to get a file listing. Depending on the server (NT vs. Unix for example), you may get away with "dir" thought "lst" (I think) is the standard FTP command. I haven't tried this with .NET but I know "back in the day" what got returned was a big string showing the directory contents. You can then find the filenames and do your own string compare to get the real filename. It's a start if nothing else works. -Nerseus
-
Populate Dataset with tables from multiple databases
Nerseus replied to rmatthew's topic in Database / XML / Reporting
Ah, sounds like you'll need to write your own "merge" type of function. Nothing built into DataSets will do what you want directly. You'll probably have to loop through the columns of table2, add them to table1. Then loop through the rows of table2, filter table1 based on the employeeID of table2, then add the data from table2 to table1 manually. Have fun! -Nerseus -
Am I missing something? Why can't use the ToBitmap() in conjunction with MakeTransparent()? -ner
-
Here's a C# code snippet (sorry, I don't know VB.NET very well but I'm sure you'll get the idea): Int64 iValue = 0; double power = 0.0; string s = "abc123"; // Make sure s is 8 chars or less. if (s.Length>8) throw new Exception("String too large..."); foreach(char c in s.ToCharArray()) { iValue += (Int64)(((byte)c) * Math.Pow(256.0, power)); power++; } System.Diagnostics.Debug.WriteLine(String.Format("Int Value of {0} is {1}, hex={2}", s, iValue, iValue.ToString("x"))); You may be able to use the above to convert the string into a Char array (a method off the string object) and pass the char array to CopyMemory. Good luck -ner
-
Populate Dataset with tables from multiple databases
Nerseus replied to rmatthew's topic in Database / XML / Reporting
If I understand you, your "query" of the DataSet is to get them into one DataTable? That should be what Merge does - copies rows from one DataTable (say table2) into another DataTable (say table1). You have options of what to do when the columns aren't exactly the same (ignore, replace, etc.). From your "example", what's wrong with disposing of DataSet2 and just using DataSet1? What kind of query are you trying to do? If it's to filter rows, you could use a RowFilter (if it's a fairly simple WHERE clause type of filter). -ner -
Are you saying that you have strings that are 8 bytes are less and you want to copy the string into an Int64 variable? Can you not convert the string to a char array and then shove the char (as a byte) into your Int64 variable? If you *must* use CopyMemory, you can still use the API - look for RtlMoveMemory and alias it as CopyMemory. Just declare the first and second arguments as the .NET types (string, Int64). -ner
-
Populate Dataset with tables from multiple databases
Nerseus replied to rmatthew's topic in Database / XML / Reporting
As I said above, you could always use the Merge method, but you wouldn't be able to Update the database when you were through - it would only allow you to view the two different tables at once through one DataSet. After the tables (or DataSets) are merged, you could manually add a DataRelation to implement a heirarchical view or whatever you needed. If you need both table's data to be seen as one table, you can merge the individual rows into one DataTable - similar to a fancy UNION :) -ner -
Maybe you could post a code-snippet to help out anyone else with the same problem? -ner
-
Populate Dataset with tables from multiple databases
Nerseus replied to rmatthew's topic in Database / XML / Reporting
Are you using SQL Server? You can join across databases in the JOIN clause in your SQL SELECT statement, such as: SELECT t1.Column1, t2.Column2 FROM Database1..Table1 t1 INNER JOIN Database2..Table2 t2 ON t1.KeyCol = t2.KeyCol The above uses the ".." syntax, which says skip the owner (usually dbo) of the table, more or less. If the databases are on different servers, you can set up a link server and still do the above. If you can't do the above, you can use the DataSet's Merge method to merge 2 different DataSet's into one. -ner -
Copying graphic contents of picturebox/panel to clipboard
Nerseus replied to Gizmo001's topic in Graphics and Multimedia
Assuming you're drawing to the Image portion of the pictureBox, you could try something like this: pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height); Graphics g = Graphics.FromImage(pictureBox1.Image); g.DrawLine(Pens.Red, 0, 0, 20, 20); g.Dispose(); Clipboard.SetDataObject(pictureBox1.Image, true); The first line creates a new Bitmap for the Image property. The next few lines simulate some drawing to the Image property (a simple red line in this case). The last line saves the bitmap to the clipboard, which is what I think you were asking...? -ner -
Do you really want to use ADODB (COM) and not the new ADO.NET provider? ADO.NET is soooo much nicer... The MSDN docs are filled with sample code. If you need me to post some, let me know. -ner
-
I know in SQL Server you can also ORDER BY ordinal position, such as: SELECT Field1, Field2 FROM Table1 ORDER BY 1 asc, 2 desc -- or is it 0 asc, 1 desc? This comes in handy if you have a complex SELECT, such as a CASE statement or subselect. -ner