jcooper's Q&A profile
Visual Basic Running an external application
Hi All: I want to program a button's click event to run a Windows batch program. Is this "legal" If so, could you either provide me with an example or point me to where I can find some documentation on this. If not, please tell me how this little feat can be accomplished elegantly. Thanks. Thanks for running the code for me, David. It turned out I did have a problem in the definition of strTextFile. Once I sorted that out, the code worked fine. Sorry to have bothered you with something so elementary. Regards, Roraima ...Show All
.NET Development Simple Enum example
I have user data stored using ConfigurationManager. I've never used enum's before...and Im trying to write a method to get multiple values from the settings. Very lost. Something like: public enum EMailSettings { emMailsender, emTo, emServer, emPort }; Can someone get me going on how to go about this...and the calls to get the different values. Thanks Ive tried a few Microsoft examples...they all seem to use Main()...which crashes. It's not very clear, I guess your trying to convert data (from your config file) to enum. Here is an example of conversion. enum MyEnum { Value1 = 1, Value2 = 2, Value3, ...Show All
SQL Server ADO.NET Please Help ??
ADO.NET is great But I have a problem I using Stored Procedures and UDFs to Insert and retrieve my data I can recieve a variable Only from UDF or Stored Procedure Put when the returned value is a set of records Whats the matter then and very especially: I need to know How to navigate through this set of records Next,Previous,First and Last Programmatically without Binding to Controls One of my Friends challenge me and Say :"Go and use Recordset as usual" But I Persist on my opinion that ADO.NET is moore efficient !!! But next Previous problem STOPS me Please any help from any of you sites links,mater ...Show All
Visual Basic Code security in VB
Hello, I have written an add-in using VBA in excel that I want to sell. It began as some programs to help me do things I do every day, but eventually grew enough and is useful enough that I think there will be some interest in it. However I am concerned about the security of my source code when distributing the add-in. From searching on the internet I have found at least one program that promises to unlock any protection in VBA. While I know this is illegal, it is easy enough that I worry that some people might do it. Is there any way for me to encrypt or otherwise protect my source code in the addin The VBA SDK 6.3 says ...Show All
.NET Development Warning: Query Builder hides SQL in VS2005
If you have multiple SQL statements in a SQL command, the query builder will only show the first one. So, for example, if you have a Visual Studio generated command to insert into a table, such as INSERT INTO [dbo].[Categories] ([CategoryName], [Description], [Picture]) VALUES (@CategoryName, @Description, @Picture); SELECT CategoryID, CategoryName, Description, Picture FROM dbo.Categories WHERE (CategoryID = SCOPE_IDENTITY()) the query builder will only show the first command. If you edit it and save it, query builder will only change the first statement, leaving the rest intact. I discovered this while editing an insert statement, and add ...Show All
SQL Server Inconsistent Errors Using Bulk Insert with a Format File
As part of a c# program, utilizing .Net 2.0, I am calling a sproc via a SqlCommand to bulk load data from flat files to a various tables in a SQL Server 2005 database. We are using format files to do this, as all of the incoming flat files are fixed length. The sproc simply calls a T-SQL BULK INSERT statement, accepting the file name, format file name and the database table as input paramaters. As expected, this works most of the time, but periodically (to often for a production environment), the insert fails. The particular file to fail is essentially random and when I rerun the process, the insert completes successfully. A sample of the ...Show All
Visual C# CopyFileEx and invalid parameter error
Hi, I'm trying to use the CopyFileEx() method, and I occassionally get a failure. When I use GetLastError, it returns "87", which unless I've looked up in the wrong place, means "Invalid Parameter". I'm having no luck determining what this error actually means in this situation. Can anyone help I have been copying the same set of files over and over in testing, and this error recently cropped up. Most of the time, the entire set of files copies just fine. But every once in a while I get this error. I am copying files to a 100Gig removable hard drive. Until yesterday, the drive was formatted to be a Linux drive ( ...Show All
Visual Studio Team System File-->Source Control-->Add Files to Source Control - How to enable?
I am trying to add non-VS 2005 files to the source control system in TFS Beta 3. How/When should Add Files to Source Control from the File menu be enabled Thanks Scott Are you trying to do this from within the IDE We would like to be able to do this using the TFS client so that our business analysts can manage documents related to our project using TFVC instead of sharepoint or VSS. ...Show All
Visual Studio Team System DisposeMethodsShouldCallSuppressFinalize woes
I've got a class that derives from a class that implements public void Dispose() and protected void Dispose(bool). My class also owns a disposable field. So, I've derived from IDisposable and implemented the Dispose pattern, taking care to have try/finally in Dispose(bool) where base.Dispose(disposing) is called within the finally block and GC.SuppressFinalize(this) within the try block (if the object has not already been disposed and disposing is true). But, I get the DisposeMethodsShouldCallSuppressFinalize error. I don't receive this error in other classes that either don't derive from a dispoable class. The foll ...Show All
.NET Development Size of object at runtime
Hello Friends, I wanted to check the size of the object (Entity & data storage) when the application is run/running. what could be possible ways My application is ASP.net based C# code behind application. Thanks in advance friends. Manohar Application Developer And to add some more info to this thread... The code above works for objects that contain no reference types or reference types marked as serialized. Running this on an object that contained a System.Data.SqlClient.SqlConnection threw an exception. I have done some research and although I haven't had a chance to try it yet, there is a code sample that supposedly s ...Show All
.NET Development Difference between Dispose() and Close()
Hello All, This regarding the difference between Dispose and close(). I have quite large amount of data transactions and queries taking place in the database. when huge data is proceed i get connection closed error. Then i changed my code to close() dispose() I wanted to know whhether this the right way to implement. Please advice !!! Regards, Shalini No you just need to call close..no need to call dispose. IDisposable is an interface that is implemented by objects that wish to clear any resources that are used and need to tell the user that the object holds some resources( so dipose can be called to releas ...Show All
Visual Basic how to add a "spinning icon" while my program is running
my program takes around 5 seconds to finish each task i'd like to put a spinning picture to make this waiting less boring just like in many installation programs how can i do that what image format should i choose thanks I guess an animated GIF is the obvious choice. Your UI and tasks should be on seperate threads for this to work, you can call Application.DoEvents in your loop if you prefer. ...Show All
Windows Forms Send text to another form
Or, get text from a textbox or label from parent form under conditions. Ok, declared this on parent form... public bool isFoward = false ; And, in the button click event.... isFoward = true ; compose newMsg = new compose(); newMsg.Show(); So, when I read isFoward from the parent form in the load event from compose form..... if (frmMail.isFoward) this .txtMessage.Text = "test"; But, isFoward is always false I even tried to create a hidden label to read but is always an empty string. I can read textbox contents though from parent form. Suggestions Thanks, Zat ...Show All
Visual Studio How to check upload only one project from VS2005 to VSS
Hello, I have one solution with 2 projects. I want to upload one of the project only to VSS. the other project is already on VSS but i have a copy locally. So how can i upload only the project that i wants If your solution and first project is under source control and your second project is not under source control but is part of your solution then you could simply check in the second project by File->Source Control->Check In or thru the context menu Check In. Another way to add only a single project to source control is to select your project in solution explorer and then select File->Sou ...Show All
Visual Studio Team System Help needed
hi all, I'm trying to write a custom rule which will check for pascal casing of the class name as well as other parameters. My problem is -- by convention, the names of types that extend certain base types or that implement certain interfaces/classes, or types derived from these types, have a suffix that is associated with the base type or interface. Example:- A type that extends System.Exception should be suffixed with 'Exception'. e.g.: DiskException. A class implementing the IComponent interface could be called Component or DefaultComponent. So how do i come up with a custom rule that can check which class is inheriti ...Show All
