Swamy Kanakala's Q&A profile
.NET Development Need Registry Edit permission for my Application
Hi All I’m developing a windows based application in C# v1.1. I’m doing a SetValue by opening a key from the Registry. The thing is it works fine only for the windows account having Admin privilege for the running machine. And it is failing for other windows accounts having No Admin privilege. Is there any way to provide this permission for Machine level so that my Application should be able to edit registry values without being an Admin. I’ve tried by using the below attribute but still it di ...Show All
Visual C++ com/atl attributes broken
It seems most of the ATL/COM attributes from 2003 -> 2005 have been broken. Im using the RTM. I just compiled a COM/ATL project which works fine in 2k3 but in 2k5 i get lots of errors with attributes. A classic is: [ uuid("xxx-blah-xxx") ] class myForwardDeclaredClass; That no longer works. I find I have to do: class __declspec(uuid("xxx-blah-xxx")) myForwardDeclaredClass; There is no documentation or acknowledgement of this problem anywhere. I wonder if anyone at MS actually tried compiling any COM/ATL projects in 2k5 before it shipped Quite simply, unless breaking changes are documented then a project in 2k3 should compile in 2k5. I ha ...Show All
Visual C# Default Text property in User Control
I've created new User Control inherited from Button and i set Text property value to " ", but when I place my control on a form it has Text equal to control name. How can I prevent changing Text property of my control Try this- public class ButtonEx : Button { string m_text; public string Text { get { return m_text; } set { m_text = value ; } } public ButtonEx() { base .Text = " " ; } } Hope this helps ...Show All
Visual C# Questions about Objects in C#
1. Do we need to pass objects by ref, if we want to have the changes made in a calling function 2. And the same question for the objects passed by Remoting 3. Do we really gain performance in calling Dispose method of DataSet while leaving from a function(the dataset is no longer required) If yes, then what does the Dispose do there Is it freeing the memory occupied by the objects If yes, then basic definition of GC itself gone right. And while the function got executed the DataSet objects declared within the function will also be removed from the reference list. Then is it required to do a Dispose while leaving a function. (I’m ...Show All
Visual C# Create updates of my Setup project…
I make a Setup Project in Visual Studio 2005 for my application. All works well but when I’m going to distribute an update in a new builded version of my application my clients have to first uninstall my application and then reinstall the new one. I get the following error when I try to install my app again: Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. How do I do to make the new release be installed over the old one The Setup projec ...Show All
.NET Development When to call dispose when using SqlConnection and SqlCommand?
What is the best practice when running code as follows: //### code start #### SqlConnection conn = new SqlConnection("xxxx"); SqlCommand cmd = conn.CreateCommand(); //...do the necessary processing cmd.Dispose(); conn.Close(); conn.Dispose(); //### code end #### calling Dispose on the cmd and the connection seems redundant. Additionally, if I am disposing hte connection should I first explicitly call Close() The shortest form is simply to call conn.Close(); however even this is questionable. conn.Close() may be valid since the connection is aware of the cmd object created with the conn.CreateCommand(), ho ...Show All
Windows Forms HOw to enable scroll bars in a windows form
Hi, I have a windows form(1.1 version) and I need to know how to enable scroll bars as some times the form won't fit the screen. Please advice me. Many thanks, -VJ Hi, you should have a property named AutoScroll in your form, set it to true: form.AutoScroll = true; ...Show All
Visual Studio Express Editions Concurrent installation of Visual C++ 6
I have some projects that were done in Visual C++ 6 Standard Edition, and use MFC. I can't import those projects into Visual C++ 2005 Express since it does not include MFC. I tried having both installed on my system, but 6 stopped working after I installed 2005 Express. Is there a way to get both versions working on the same system Alternately, is there a way to get the MFC libraries from version 6 to work with 2005 Express You can install both at the same time but it is really not recommended to compile the MFC headers with the new VC2005 compiler since you might run into conformance issues. Also, mak ...Show All
Software Development for Windows Vista Calling Methods from dynamically created workflow
I'm creating a sequencial workflow dynamically & to this i add the CAG activity which in turn will have a custom activity ( inherited from Activity) added at runtime. Now on CAG UntilCondition i want to call a method ProcessCAG( which is part of some utility file & if i want it to be part of CAG cannot include it since CAG is sealed & cannot create my own custom CAG) which does some processing & return in the bool value, similarly on WhenCondition on customactivity i need to call a method ProcessCustomActivity( which is part of custom activity itself) which again does some processing & return in ...Show All
Visual Studio Print doesn't match Preview
All of my reports, they preview ok, but when print, right side of report will be chopped off. I am using July CTP. All reports are in local mode, using WinForms ReportViewer control Any idea to this Thanks ...Show All
SQL Server SQL 2005 schema problem after installing SSIS
I restored a backup from SQL 2000 onto a new SQL 2005 server. The database restored and the matching user who was the owner of that database in SQL 2000 was created as a user in SQL 2005 as well as being designated as the "schema" for that database. I was having trouble logging in with the user that was created after the restore, so I created a new user and assinged the new user as DBO of the new database, set up the new users default database and schema, and everything was working fine, my database driven application worked perfectly under that user. Then I installed SSIS, as it was recomended as a solution to anothe ...Show All
Visual Basic Data sources invisible in Form Design View
When I'm viewing a form in design view, the contents of my data sources window is blank. The Add New Data Source, Edit Dataset with Designer etc. are all grey. If I switch to the code view of the form, the data sources window is fine. But goes blank again as soon I switch back to design view. This means I can't drag any tables or fields onto my forms, which is a bit of a hinderance! My projects used work with the Beta 2. I have just uninstalled it, using the MS tool. I then installed Visual Studio 2005 Team Suite - Release Candidate. And now have this problem, on my older projects and any new projects. My Help/About data is below. Any ideas ...Show All
SQL Server Pivot table published in a web page : Error (Data mining)
Hello, I've created an OLAP cube in SQL server 2005 Analysis Services, i browse it successfully, and i was able to use pivot table in Excel 2000 with no problems. But when i try to save the result in a web page in order to publish it in a html page, i get this error: Impossible de connecter la liste de tableau croise dynamique a la source de donnees "DataBase". Pour plus d'informations sur la source de donnees, consultez le createur du fichier. 0x80004005: "Error (Data mining): Either the user, "My profile", does not have permission to access the referenced mining model, "DataBase", or the object does not exist." I used to publis ...Show All
Visual Studio Word shared add-in not loading (deployed using Setup Project)
Hi, I try to deploy a very simple shared add-in (message box popup) for Word 2003 to a test machine that is not my development machine. I am using the automatically generated Setup Project with absolutely nothing changed to it. - On the dev machine (VS2005) : the popup shows up correctly. - On the text machine : I have installed the add-in using the automatically generated Setup Project, but nothing happens in Word. The add-in is not in the disabled items of Word not in the Comm add-ins. All required registry keys are present. Office 2003 SP2, Framework .NET 2.0, Office 2003 PIA, VSTO redist libs are installed. Please help ! ...Show All
.NET Development Network traffic
I am working on one application which must catch all outgoing and incoming data on the machine on which the program is running and I am wondering how can i do that - with TcpListeners or... Thank you. First up, when it comes to sniffing on almost any platform, one should definetly look into the Pcap library, or on Windows, the WinPcap library. That being said, take a look at one of these tutorials on using C# and WinPcap to do network packet sniffing: Packet Capture and Analayzer Network Sniffer and Connection Analyzer Otherwise... you could try some raw sockets with: RawSocket Clas ...Show All
