DriverEntry's Q&A profile
.NET Development Security exception when write to event log
Hi, I try to write to the event log using trace. I always get a SecurityException error on the last row cod. protected void btnEventLog_Click(object sender, EventArgs e) { // Create a trace listener for the event log. System.Diagnostics.EventLogTraceListener myTraceListener = new System.Diagnostics.EventLogTraceListener ("myEventLogSource"); // Add the event log trace listener to the collection. System.Diagnostics.Trace.Listeners.Add(myTraceListener); // Write output to the event log. This line raise the exception. System.Diagnostics.Trace.WriteLine("Test output"); } The message for this exception is : " Requested registry access is not allowed ". I hav ...Show All
.NET Development Going crazy updating database
I'm about to go crazy about this. I have a database with a couple of tables. I have inserted all tables into a dataset. The data is modified partially by databound fields and partially by manual adding/deletion/modifying. The problems come when i try to transfer dataset to database. I have tried a shitload of different ways but it won't work. This last time i tried OleDbCommandBuilder mybuilder = new OleDbCommandBuilder(MyAdapter); MyConnection.Open(); DataSet ch = MyDataSet.GetChanges(); MyAdapter.Update(ch, "Currencies"); MyConnection.Close(); where Currencies is a table in my database. I have also tried OleDbCommandBuilder mybuilder = new OleDbCommandBuilder(MyAdapter); MyConnect ...Show All
Windows Forms Datagrid Cell return
Can anyone tell me if there is anything wrong with these statements: int _MyRow = this .currentTransactionsDataGridView.CurrentCell.RowIndex; int _MyCell = this .currentTransactionsDataGridView.CurrentCell.ColumnIndex; string _Account = this .currentTransactionsDataGridView.Rows[_MyRow].Cells[_MyCell].Value.ToString(); _Account is always "" - when I know its not. sorry for the previous post. Try this private void dataGridView1_CellLeave(object sender, DataGridViewCellEventArgs e) { string ss= dataGridView1[e.ColumnIndex, e.RowIndex]. .EditedFormattedValue.ToString(); } ...Show All
SQL Server Create Login form(authenticate with sql)
Hi all. M trying to create a logon form I had something in mind but i can work it out yet When the user wants to login into the application the value of textbox must be compared with the datafield in the sql server. And then i want a messagebox to show up. I created a table in sql server with 2 fields in it , User and Password. I hope anyone could help me tnx already You will need a login which is able to access the table or a stored procedure which does the check of the login for you. Then its up to you to either raise an error from your stored procedure or return a specific result fromthe stored procedure which is transformed into a user friendly message like "Password wrong" or "Use ...Show All
Visual C++ I can't figure out this syntax error
Hello, I'm sure that there's a simple answer to this VC++ 6.0 compile error, but I'm stumped. I have a fairly large workspace (a dozen or so projects) that I'm modifying. All was well until this afternoon, at which point I started getting compile errors for one of the .cpp files in one of the projects. I have not touched the file that no longer compiles, nor any of the header files it uses. I've confirmed that the current file is identical to the one that last compiled correctly, and that all of the .h files are also identical to their "correct" version. Restarting the IDE doesn't help. Might there be some remnant of an earlier action, unrelated to the content of these source files, that is the cause of the problem I ac ...Show All
Visual Studio Express Editions Read only property?
i have a bitmap, and i want it to be controlled by the keyboard. my present code is... Private Sub Form1_KeyDown( ByVal sender As Object , ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me .KeyDown Select Case e.KeyCode Case Keys.Left rect.Left -= 25 Case Keys.Up rect.Top -= 25 Case Keys.Right rect.Left += 25 Case Keys.Down rect.Top += 25 End Select End Sub Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load Dim TmpCtr As Control For Each TmpCtr In Me .Controls AddHandler TmpCtr.KeyDown, AddressOf Form1_KeyDown Next End Sub After writing this, blue li ...Show All
Visual C++ COM DLL, regsvr32 and manifest - blech!
I have a COM DLL that relies on MSVCR80.dll and when I try to register it with regsvr32.exe I get a "loadlibrary failed -2147220473" error. If I create a regsvr32.exe.manifest file and place it with regsvr32.exe, then it works. There has to be a better solution though. I can't count on target PCs having regsvr32.exe.manifest installed (and I'd rather not install it if possible). That did the trick. Thanks! Although it would be nice if the mt.exe tool showed an example of embedding a manifest in a DLL or EXE. It shows just about every other possible usage except that one. ...Show All
Smart Device Development Idle functions
Hello I wonder how to implement an idle function I searched the SDK but couldn't find any appropriate functions. I only found .net Application.Idle but since I don't use .net it's not for me. Could anyone please give me some pointers Many thanks, Martin Malek Not sure what you mean by "idle" function. Perhaps Sleep() would do You can call it with 0 to release CPU time. ...Show All
SQL Server Do you need 1 or 2 SQL licenses to install RS on separate web server?
Plese help with this issue by reading and responding!!! If you install Reporting Services 2005 on a separate web server from the database engine do you need 1 or 2 SQL licenses It's a more complex issue than it initially appears to be. Please go to the following thread and read the bottom of page 1 and page 2. Please help verify this! Page 2 contains a post with 5 steps that you can perform to verify that only 1 license is actually need! http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=198900&SiteID=1 Note: Unfortunately this discussion got started in a off topic thread in the wrong category. I wrote this thread so that interested people could find it. ...Show All
Visual Studio Changing the size of the notes associated with check in / check out
I have just started using VSS2005 having used CVS a little in a previous life. I was a little frustrated at the apparent low limit on the number of characters I could put in to the comment associated with my first check out / check in. Is there any way to change this limit or am I doing something wrong Thanks We're going to need a bug tracking system too! I had thoughts on that but I hadn't done anything about it yet. It's a very small team! I know it's going slightly off topic but would you have any suggestions other than Bugzilla ...Show All
Visual Basic Design question reading data
Hi I sometimes include reports and charts in my apps. If I need fast cube like functionality I load lots of data into memory from the db. Then I use nested For Each... to read the data form the objects. Sometimes I have 4-5 levels (first object have a collections and each object in that collection have their own collections and etc....) I have never had any problems doing this, but clearly this is not best practise (first of all since the number of transactions is unknown). I have tried to find a vb.net sample code on this but no luck. Could someone point me in the right direction. Thank you. Hi imnotbillg, It's hard to say what a best practice is. The reason this is hard to say is because there are many variables to determi ...Show All
Visual C# Which of these two methods are more efficient?
Hi folks, we have a class that creates a unique ID when required. There are two ways we can do this -> one using late binding and GUID's, the second using static longs. We're not sure which way is more efficient. I'm guessing (based on no facts what-so-ever :) ) that the GUID is more efficient but contains more memory in the long run. Both methods are implemented with native functions, so there isn't much to speculate on, unfortunately. I made a crude test, calling one million times the Interlocked.Increment and one million times Guid.NewGuid, timed with a Stopwatch. The static long version seems to be six times faster than the Guid counterpart... which I must say was not entirely unexpected since a Guid is more comp ...Show All
SQL Server how to get the duplicate file in ssis
is it possible that i can retrieve the list of all records that are duplicate and put them in a excel files Hi There, Use this query to get the duplicate records from a table, if you are using flat file as a source, load it to the database table and use this query: select coulmn a from <tablename> where column a in (select column a from <tablename> group by column a having count(*) > 1). This query will give you the list of records which is duplicate. Later you can add an excel destination to load these duplicate records. Regards, Raju ...Show All
Smart Device Development .NET Compact Framework v2 SP1 Patch for VS 2005 is now available.
Q. What is that exactly A. This is a patch (as in difference between old version and new one) for NETCF V2 RTM which updates existing NETCF V2 installation to SP1. It is intended for VS 2005 users only. Q: I've copied this patch to my device, but it won't install. Is that because I'm low on storage memory A: No, that's because this patch is for desktop , not for device. Please install it on desktop, do not copy it to device. Patch would update original NETCF MSI (which is also for your desktop) to SP1 and VS would deploy changed NETCF CAB automatically. Q. Is there a difference between updating existing installation with this patch or uninstalling it and installing NETCF V2 SP1 MSI A. Technically no, final result ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Buying Pre-made models for XNA
What is the best source to buy pre-made models for XNA Does anyone know of companies out there that will make custom models on demand I would also like to know what the best meshing/modeling tool for XNA. We have been playing with Blender 3D. I have tried incorporating pre-made models from turbosquid.com and not all of them work. The ones in .x and .fbx format work fine, but most of the texture size are not in the factor 2 scale, and we might need to manually resize them. Thanks Kyle_W, we are an academic group at MIT and are working on an RFID simulator. We need to build accurate models of buildings, such as warehouses and retail stores, for our RFID enabled robots to move through. We might also need a model of a city. I ...Show All
