Ke Sun's Q&A profile
Game Technologies: DirectX, XNA, XACT, etc. How to Detect Minimum System Requirements?
For the PC version of my game, I would like to be able to detect if the user's computer has the minimum system (and graphics) requirements for XNA. If they don't, I want to display a message to that effect. In the beta versions, there was a boolean method called EnsureDevice() which worked quite well for me but that appears to no longer be in the 1.0 version. Is there an equivalent method or algorithm I can use for this I suppose I can use a TRY-CATCH block when creating the Graphics component and respond accordingly if that fails, but that seems like a less-than-elegant approach. Any suggestions I use this in my Dr. Popper game, feel free to steal it (it's based on a documentation sample in XNA G ...Show All
SQL Server Return Value when a query does not return any values
SELECT @NEWVALUE = inserted.VALUE,@EQNAME = inserted.TEST1 FROM inserted where inserted.TEST2 = 'Area' When the result of this query does not return any records, how do i check this condition by looking at the NEWVALUE variable Checking NEWVALUE against null or "" does not seem to work. SELECT @NEWVALUE = inserted.VALUE,@EQNAME = inserted.TEST1 FROM inserted where inserted.TEST2 = 'Area' IF (@NEWVALUE is NULL) BEGIN PRINT 'NO ROWS RETURNED' END When i run this query and the query does not return any values, i do not see the print statement getting executed Of course, if inserted.value is actually NULL, a ...Show All
SQL Server Handling encryption at the application level
Developing an application, which is handling encrypting for a SQL server 2005 DB at the application level, using symmetric AES encryption. After being encrypted the data is being sent to the SQL server 2005 DB to be inserted. This is what I want to accomplish. But I have one or two questions as I am going through the research for my project. Encrypting the data shouldn’t be that big a deal, but can SQL server 2005 handle to insert these data If yes how I am thinking just simple SQL INSERT statements When the data are inserted can SQL server, as it supports AES encryption, through the DBMS decrypt the data as they have been encrypted else where and then perform specific functions (by specific function I just mean any functio ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Getting unmanaged device pointer from MDX2.0 Direct3D device
Hi graphics forum, Using MDX1.0, I was able to get the unmanaged device pointer from the Direct3D device using device.UnmanagedComPointer, however in MDX2.0 this property is removed! How can I get the unmanaged device pointer from the Direct3D device I require the unmanaged pointer to pass to the DirectShow function vmrSurfaceAllocatorNotify.SetD3DDevice(). Kind regards, wtrn Also, please don't refer me to http://msdn.com/directx/beta , because when I visit this link all I can read is "there is no beta at this time". Kind regards, wtrn ...Show All
Windows Forms Splitcontainer adds flicker (!) / Ultra-simplistic sample attached
Unfortunately, using Splitcontainer adds flicker. Is there anything you can do about it Please compile the following example code to see for yourself (uncomment the first #define to see the splitter in action): //#define USE_SPLITTER using System; using System.Drawing; using System.Windows.Forms; public class Demo : Form { Control _controlA = null; Control _controlB = null; ListView CreateListView() { ListView listView = new ListView(); listView.View = View.Details; /* Add columns */ for(int x=1; x<=5; ++x) listView.Columns.Add(x.ToString()); /* Add entries */ const string text = "abc"; for(int x=1; x<=10; x++) { ListViewItem item = listView.Items.Add(te ...Show All
SQL Server AS400 DB2 connection strings
I am trying to construct a connection string via iSeries OleDb provider. The default list of libraries on the AS400 for my user is fine for production. But in test scenarios the code/data libraries are rolled out through a sequence of test libraries. How do I specify the additional libraries for testing. I connect fine and can execute sql. the statements like insert into TestLibrary.Table work fine, but the associated trigger code isn't called. Would it be better to use the .Net Connection set of classes instead. I switched from ODBC to OleDb because of assumed thread safety issues. This link might help: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1061900&SiteID=1 ...Show All
Windows Forms Designer Fails to Show From after VS 2003 Port - Problem Fixed!!!!!
Original Problem: After porting a project to VS 2005, the designer fails to show the forms in my project. When I try to view the designer, I get Object reference not set to an instance of an object How do I fix this Is it possible that the resx files are corrupt Can I regenerate them ------------------------------------------------------------ Solution The problem was solved. It turns out that one of the project wide language resx files (we have four) had a slightly different format than the other project wide language resx files. When we made the resx files consistent, the designer worked. The individual form resx files were ok as is. I gue ...Show All
Visual Studio Automatic compilation
Hi, in my current project pressing F5 does not automatically compile and run the application. And not even pressing F6 or choosing "Compile solution" compiles the project. I always have to right-click on my project and click on "Recreate" (words translated from German IDE). What do I have to do, to get the old behaviour In other projects/solutions everything works okay. Thanks! This is currently being discussed in a few places. For example http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=169326&SiteID=1 ...Show All
SQL Server Trapping errors in the control flow
SSIS GURUS: I have read several posting about various modes of trapping errors, but none seem to directly address what I am looking for (SQLIS.com.MSDN, etc) Coming from a Java/C# background, I am looking for a way to trap errors that arise within the ssis control flow much like the said languges: try { do something } catch(AnExceptionType myException) { handle my exception } / ** my code at this point is unperterbed by the exception unless I explicitly raise the exception out of the scope of the exception handler. */ To make the analogy in SSIS, I want to be able to handle an error within a "container" and not have to handle the same error in surrounding containers. Example: I have a "Fo ...Show All
SQL Server Access project connecting to SQL 2005
Most of our users are using MS Access project to work with our data in SQL Server 2005. The problem we have is that in order for them to access the tables they need to be given db_datareader and db_datawriter permission on the database. Our goal is not to give access to the tables themselves but to views. Therefore, we've created several views and placed them into a particular schema. Now we want to give access to that schema, but when we assign select, delete, insert, and update to that schema user in ms access project aren't able to view these tables. When we give them db_datareader permission they are able to see the views but in parentencies does not show the correct schema; therefore, when you try to open that view it errors out sayin ...Show All
SQL Server need direction on SSB replacing existing technology
Hello, I have an existing suite of applications in my company where remote laptop users enter data into a local database instance. There are several different applications with several different databases (some users run application A and C, others run A and B and D, etc). All of this data needs to make its way into both their local databases, and to the front office database. In addition, some of the data goes out of the front office to other end users (supervisors get data from people under them). Currently, we get the data back and forth by creating text files full of SQL statements that are run on either the end user servers or the main server, and we zip and ftp these SQL Script files back and forth. I am looking into the benefits of ...Show All
.NET Development GetRequestStream() throwing SocketException
Hello, I am still very much a novice when it comes to .NET and programming in general so please excuse my naivete. I have a Windows Mobile 5.0 app written in Visual C# .NET CF 2.0 I had a very simple login program that would query a MySQL database on a server and return some info about the user logging in. This code was working fine a couple weeks ago, and I got sidetracked to another project. Well, today I went to do some more work and I noticed that I could no longer login. My database was accessible and my login info was correctly entered. So I did some debugging and noticed that a line of code I had was throwing a WebException: System.IO.Stream os = req.GetRequestStream(); Since WebException wouldn't give me many details I checked on t ...Show All
SQL Server How to select the row that has the maximum value in one field
This has me stumped. I have a table UnitRateItems with the following columns ItemID, Description and table UnitRates with the following columns ItemID,Year,UnitRate UnitRateItems and UnitRates have a primary-foreign key relationship on ItemID. In UnitRates, there may be several rows with the same value for ItemID but a different value for Year. What I want to do is pick the row with the largest value of Year for a given ItemID. I want to do this for ALL the rows in the table (not just for a particular ItemID). In other words, I want to return one row in UnitRates for each row in UnitRateItems. I want that one row to be the one with the highest Year for that ItemID. It sounds simple, but I can't see ...Show All
Visual Studio Problems with Dataset
Hi, I would like to know when to set the datasource of the crystal viewer from code I'm doing this : Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load ' filling the dataset ' .... report.SetDataSource(dataSet) Me.CrystalReportViewer1.ReportSource = report Me.CrystalReportViewer1.Refresh() The dataset I'm passing to the viewer contains only one row; when the viewer is displayed, it shows all the data, so it means it shows data returned by the query in the report itself, not from my dataset, like it's overwriting my dataset. Is there a more appropriate event than the Load method of the viewer to set the datasource to my dataset ...Show All
.NET Development Increasing Memory Usage in .NET 1.1 (Very Urgent)
Hi, I've developed a dummy WinForm application (named GCTest) with the following functionality in .NET 1.1 (VS2003): 1. In Button1 click, a text is assigned to a Label. 2. In Button2 click, i've called GC.Collect(). While running this app, without doing anything, the memory usage is increasing from 10KB to 100KB. If i'm moving mouse, resizing, minimizing or maximizing the window, the memory usage is increasing consistently 60KB. If i click Button2, then memory usage increased upto 100KB. My machine config: PIV 3.2GHz, 1GB RAM .NET Version: 1.1.4322.2032 (i.e with service pack 1) OS: XP SP2 How can i stop the increase memory usage problem Regards, Udooz NNTP User ...Show All
