sunil babar's Q&A profile
Windows Forms Need help with SendInput function
Hi, this piece of code is supposed to print a letter, but nothing happens. Can anyone help me to find what's wrong Thanks. // Structures for keyboard input public struct KEYBDINPUT { public int vkCode; public int scanCode; public int flags; public int time; public int dwExtraInfo; } public struct INPUT { public int type; public KEYBDINPUT ki; } // Declaration of SendInput [DllImport("User32.dll")] public static extern int SendInput( int nInputs, ref INPUT pInputs, int cbSize); // Function that outputs the letter public void PrintMyKey( int vkCode) { INPUT input = new INPUT(); input.type = INPUT_KEYBOARD; input.ki.vkCode = vkCode; SendInput(1, ref input, 28); } // Call that function PrintMyKey(65 ...Show All
Visual C++ When "It just works!" doesn't. :(
Hi, To test out "C++ Interop", I created a static library in VC++ 6.0: Here is the contents of the header file (staticLibrary.h): #ifndef STATICLIBTEST_H #define STATICLIBTEST_H #include <string> using std::string; int add352(int value); string sayHello(string name); #endif Here is the implementation (staticLibrary.cpp): #include "staticLibrary.h" int add352(int value) { return value + 352; } string sayHello(string name) { string s1("Hello, you are the greatest, "); return (s1 + name + "!\n"); } This code compiles fine in VC++ 6.0 and it produces an object called "staticLibrary.lib ...Show All
SQL Server executing multiple query at one time
hi, i am making a n application which in between deletes the multiple tables from the sql database. for that i have written the following code: SqlCommand cmd = new SqlCommand (); cmd.CommandText = "delete from " + dbConstt.DBSchema + ".PicassoSelectivityLog where QTID=" + qtid; cmd.ExecuteNonQuery(); cmd.CommandText = "delete from " + dbConstt.DBSchema + ".PicassoSelectivityLog where QTID=" + qtid; cmd.ExecuteNonQuery(); in this way, many more tables are to be deleted. is there any need to create the new SQLCommand object again an\d agin for each and every query. can iot be done like the given above or can there be some better method thanz in advance.. ...Show All
Windows Forms BindingSource multiple DataGridViews...
I have three different tables in my database, and they all have a relation. I want to show each table in a seperate DataGridView object. My understanding is, you need a seperate BindingSource object for each DataGridView. Example: DataRelation relation = new DataRelation("CustomersOrders", data.Tables["Customers"].Columns["CustomerID"], data.Tables["Orders"].Columns["CustomerID"]); data.Relations.Add(relation); masterBindingSource.DataSource = data; masterBindingSource.DataMember = "Customers"; detailsBindingSource.DataSource = masterBindingSource; detailsBindingSource.DataMember = "CustomersOrders"; === Then you set one DataGridView.ataSour ...Show All
SQL Server Tempdb Issues Urgent Help
Hi, I have an app that changed the tempdb such that now I have 123GB of free space on the tempdb and is filling up my drive. When i use sp_spaceused I get the follwoing name dbsize unallcated space tempdb 123969.12 MB 123866.02 MB 872 KB 320 KB 400 KB 152 KB reserved data index size unused My question is this is production so shrikfile is it an option as i think since it is the space at the end of the file that i need what can I do other than restarign SQL Dear Traveller, Try this file on your tempdb, I specifically created it to truncate transaction logs , it requires .net fx 2. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; ...Show All
Visual Studio Team System Omitting Process Guidance stuff?
So right now I'm running a somewhat customized version of the Agile process template. What I'm noticing is that as I create more projects, every one gets its own duplicate copy of the "Process Guidance" pages, which total a good 5+Meg of "stuff". I'm perfectly happy with keeping *a* copy on my Sharepoint portal in case anybody wants to review it, but I really don't need a copy for each and every project. I'm thinking it's just a matter of tweaking the WssTasks.xml under "Windows Sharepoint Services" to omit most of the files under "Process Guidance", except maybe for the initial "ProcessGuidance.html" file which I can massage to merely contain a link to my "master" copy elsewhere. ...Show All
Visual Studio 2008 (Pre-release) Certificate Requirements for Usage in WCF
We are trying to come up with deployment time requirements for certificates to be used in WCF. We need to check for certificates (that are present on the target machine) that have following abilities: SSL Encryption Signature In essense, how do we find out if a given certificate can perform one or more of the above Is checking for System.Security.Cryptography.X509Certificates.X509KeyUsageFlags of a certificate (through Extensions) is enough If so, how do above map to following in X509KeyUsageFlags enumerations: DataEncipherment (The key can be used for data encryption.) DecipherOnly (The key can be used for decryption only.) DigitalSignature (The key can be used as a digital signature.) EncipherOnly (The key can ...Show All
Software Development for Windows Vista Power icon problem
Hello, I've just installed the Windows Vista Beta 2 (Build 5384) and so far so good, except for one thing: somehow i can't activate the option to show the power icon on the "notification are" of the "taskbar". When i go to the properties of the "taskbar", and then go to the "notification area" options, i'm allowed to select to always show the clock, volume and network icons, but not the power icon. Do you know what can i do to fix this problem Because of this problem, i never know when the battery is low. Thanks for your help!! If your machine is battery-enabled, you should see the battery icon in the tray area by default. You should also see a checkbox in ...Show All
SQL Server Problem when i am using RSClientPrint Active X
Hi , I m using rsclientscript in my application..i m using the following code in <script> function Print() { RSClientPrint.MarginLeft = 12.7; RSClientPrint.MarginTop = 12.7; RSClientPrint.MarginRight = 12.7; RSClientPrint.MarginBottom = 12.7; RSClientPrint.Culture = 1033; RSClientPrint.UICulture = 9; RSClientPrint.Print('http://localhost/Reports/Pages/Report.aspx ItemPath', '=%2fTestMonday%2fSrCorpLogo&CorporationId=2', 'Employee_Sales_Summary') } </script> I m calling this script when user clicks the button in the webpage.. I m getting the dialog box properly..In that if i click preview button i m getting the following error "An error occured trying to render the report. (0x80004005)" Please ...Show All
SQL Server Programmatically changing a DataReader's SQL statement
Hi, I was wondering how I could dynamically change the SQL statement (ie the SQLCommand property) of a DataReader source. The source is reading an IBM AS400 file, with the SQL statement: SELECT itrloc, itrdat, itrcen, csreg#, cstrn#, csseq#, inumbr, cstime, itrqty, itrret, itrreg, itrcst, idept, isdept, iclas, isclas, csdosp, cmcust, csacct, salit, cstntp, csldgr FROM clib.scsaltrn WHERE itrdat between 50901 and 50931 I want to programmatically change the date figures on the end (50901 and 50931) each time the package is run. I have tried to use variables in place of the date figures but this didn't work. I've also thought of using the Script task to programmatically modify the DataReader source, but this doesn't seem possible. Any ideas ...Show All
Silverlight (formerly WPF/E) Why using "javascript:functionName"?
Hi, I would like to get an answer why the JavaScript event handlers have to be written not very JavaScript like. element.loaded = functionName"; instead of element.loaded = functionName; Will there be any other protocol available than JavaScript Michael But MyNamespace.MyAssembly looks like that you are thinking of .NET. Maybe I'm wrong, but I thought that WPF/E (compared to .NET 3.0 and WPF) will not install a framework on the client side (in the future, too). So, my only idea was only that it could be something inside the XAML code, a function or action that could be referenced there instead of JavaScript. Perhaps somebody from Microsoft could give us a short answer. ;) Michael ...Show All
Visual FoxPro Suggestion for VFP-MySQL Multiuser env.
Hi all, I've just shifted from Foxpro tables to MySQL server based application. For a multiuser environment in VFP I used to have the temporary tables for the individual users in their own local machines. But in case of Mysql / oracle how to handle this situation The temporary table that I 'm speaking of are generated when I want to create some reports or perform some maintenance on tables. For example consider a scenario of producing a Sales analysis report. In VFP based application I created a local table say temp and put the data from invoice, invoice return and all related tables. then I manipulated the temp table to suit my reports. There was no problem in multiuser env. since each user created their own 'temp' table in thei ...Show All
Visual C# How to get uptodate user information with WindowsIdentity object?
I have the folling codes in C# WindowsIdentity user = WindowsIdentity .GetCurrent(); IdentityReferenceCollection groups = user.Groups.Translate( typeof ( NTAccount )); Everything works fine. However, whenever I change something in ActiveDirectory for a user, the user must logoff and log back in to see the changes. Are there anywany for me to force WindowsIdentity object to get the uptodated Groups without logoff and logback in Regards, JDang Until at this point, the user must logoff and login again to see the changes. You can call GetCurrent() many times but the Groups remain static. Do you think this is a bug Regards, Jdang ...Show All
Visual C# .Net controls looks like Win95 in a BHO
Hi Somebody knows why the .Net Contrlos (e.j. tabControl and Button) have a look as controls of Win95 inside a BHO How can I get that the controls looks like WinXP Where is my error I'm sure that is possible because I have seen BHOs where the controls have the WinXP look. I developed my BHO with Visual C# Express, .Net FrameWork 2.0 and works fine in IE7 beta and Window XP. Deza ...Show All
SQL Server Report SnapShot Creation Programmatically through Java
Hi, I am facing some issues while creating report snapshots programmatically using axis (Java platform for creating and deploying web services applications). To create a report snapshot what should be the methods called I tried using UpdateReportExecutionSnapshot() but didn't find any parameters to set the schedule information which would say when the execute the report snapshot. Can you please guide me for this Also I had one more doubt regarding report snapshots. If a parameterized report is configured as snapshot then we would require to set default parameters for the report. Is there a way to create snapshots of the same report with different parameters eg : The employee information report displays the information base ...Show All
