Answer Questions
john1983lj Adding C# code to VB.NET 2003 project
I have a VB.NET 2003 project. I have writtten a small code in C# and I want to add it to that project. I also want that when a Command Button on VB.NET Form is clicked, the C# code must execute. Any way Any link to illustrate the same. I think that you have to add it into a separate project in the same solution. You can then call the methods between projects. You will need to add a separate C# project to your solution, and than add a reference from the VB project to the C# project. Of course, the C# methods will also need to be accessible to callers in VB. -Tom Meschter Software Dev, Visual C# IDE ...Show All
leo1 Help on Conditional operator ?:
This works... if (searchDate!= null ) { cmdP0.Parameters[ "@Medical" ].Value=searchDate; } else { cmdP0.Parameters[ "@Medical" ].Value= DBNull .Value; } so why does the compiler not allow... cmdP0.Parameters["@Medical"].Value = searchDate!=null searchDate:DBNull.Value; ------------------ I've been having trouble getting null values into my table when getting anything but text (eg ints & dates) from my textboxes This code helped solved part of the problem string inputDate = txtmDoLM.Text; DateTime searchDate = null ; if (! string .IsNullOrEmpty(inputDate)) { DateTime date; if ( DateTime .TryParse(inputDate , out date)) searchDate = date; } } I couldn't use DBNul ...Show All
DroopyPawn Three questions regarding C# and .NET of today and tomorrow
(I was pointed to this forum by Erik Jarvi after pestering him personally with these questions) Hi I have three questions regarding C# and .NET. I don't know if this is the best forum for these questions but here goes. C# question 1: Is there any possibility in .NET 2.0 to create a class that mimics the semantics of this: class A<B> : B { } It might look obscure but that doesn't stop it from being usable. Let A be a generic IDisposable implemetation that encapsulates all the tedious implementation details of IDisposable pattern and let the programmer just implement the disposing. If I had my_class which need to inherit from your_class. Let's say I need to add IDisposable pattern to my_class. Then if the above would ...Show All
coln set font heigth in pixels
Hello, I want to draw a string using Graphics.DrawString() How can I set the Font height in pixels I have to fill a control with text lines, and the lines should fit the control. If I use new (Font fontFamily, float size, GraphicsUnit.Pixel) its get to large. thanks for help! Dirk Note that the em-size does NOT include a font's "internal leading" space (which is the space for accents etc). More detailed information available here: http://support.microsoft.com/kb/32667 The Font class constructors that don't have a GraphicsUnit parameter parameter default to point units. If you don't want point units you can use one of the constructors tha ...Show All
Leon.I Calling C/C++ DLL function Entry Point Error
I have a dll that was made for C/C++ in Borland. The problem is that I keep getting an "entry point not found" error when I run the program. When I compile, I get no errors. I use DllImport like this: [DllImport("C:\\Program Files\\SPF\\SpfIIDll.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, EntryPoint = "InitSpfII", ExactSpelling = true)] static extern unsafe int InitSpfII(char* cSpfCfg, char* cHardwareCfg); When I call the function, I do it to allow a char* by doing this: fixed (char* spfcfgpath = spfpath.ToCharArray()) { fixed (char* hardwarecfgpath = hardwarepath.ToCharArray()) { initValue = InitSpfII(spfcfgpath, hardwarecfgpath); } } I know that the function exists and I have the heade ...Show All
Edgar Piraneque Unable to update the dependencies of the project
I have had this error every time I try to check my program into source control after making changes. The project builds and works fine until I check it in and check it back out then it won’t build. I have deleted the setup project and built a new one only to have the same problem after checking it into source control. It also givs me a warning that " Assembly ' FolderName\FileName.exe ' is incorrectly specified as a file. Any suggestions would be helpful. With VSS unbound from the IDE I find the problem less likely but still occurs. I've also been able to recover by hacking about with the Hierarchy section in the vdproj file (confirming your findings that this is the part that screws up when things go ...Show All
Tony Maynard-Smith License Class
Hi, I would like to implement the license class in my project. I tried so many available components, but every one is using the License class provided by the .net. Could u help me out to implement that class and pls send me a working example. Thanking You in Advance Gaurav Gupta ASP.NET related questions should be asked on http://forums.asp.net/ Thank you Hello Sir, thanks for replying. but this license is required to be implement in the Windows form application not in the asp.net application. I would like to add this on a Windows form. Thanks for your reply Gaurav gupta ...Show All
Martijn Mulder Unable to upload file to OS/400 using FTPWebRequest Any idea ?
When I issue following command to OS/400 i-Series system : Error is exception = {"The remote server returned an error: (501) Syntax error in parameters or arguments."} Work good for ftp://localhost (windows operating system ) FTPAddress contains FTPAdddress : = ftp://ip address/path/test.txt request = ( FtpWebRequest ) FtpWebRequest .Create( new Uri (FtpAddress ) ); request.Method = WebRequestMethods . Ftp .UploadFile; request.Credentials = new NetworkCredential (FtpUserName, FtpPassword); request.Timeout = FtpRequestTimeout; Stream requestStream; byte [] buf; int i; Getting error right here---------> when calling getrequeststream() method. requestStream = request.GetRequestSt ...Show All
Tobey79 Why File Opens in Broswer Window
i'm using .net 1.1. Can somebody try to answer this question http://forums.asp.net/thread/1357943.aspx View=Flat The way ASP.NET works is that when a post-back event occures (such as a button click), the page sends the appropriate data to the server, the server updates the form and re-generates the HTML and sends it as a response, and the browser reloads the page with the new HTML. In order for you to be able to change the button's state from the server, you have to do this. However, instead of sending back the page, you are hijacking the response to send your receipt file. There really is no simple way to "fix" this. I think you need to think about your whole approach here. For starters, wh ...Show All
David Bridgestone Invoke a WebService automatically (using a Timer)?
Hi, I have a small C# app that FTP's a file from a remote to a local server. The file it gets from the remote is available each evening at 2AM. Currently it is run manually (gasp!). I'm considering ways to run this automatically and would appreciate suggestions. I have the code running both in a Websevice and a Windows form. Since no one needs to see an interface for this app, I'm thinking of deploying the WebService..... I'd like the WebService to either run all the time (which seems excessive) or want to have it start around 2AM and stop around 4 AM (in case the file processing on the remote is delayed for some reason) How can a webservice be invoked "automatically" Create a Windows Service app that invokes it Wou ...Show All
MACSkeptic Passing two paramaters
I have an app that I am trying to build using the BackgroundWorker Component, and I am having a little bit of trouble figuring out how to pass multiple paramaters back with ReportProgress. Below you can see the two small code snippets. Any help would be greatly appreciated. Thanks, Russ ////////////////////////////////////////////////////////////////////////////////////////////////////// (sender as BackgroundWorker ).ReportProgress(currentCount, totalCount); ////////////////////////////////////////////////////////////////////////////////////////////////////// void backgroundWorker_ProgressChanged( object sender, ProgressChangedEventArgs e) { progressBar1.Value = (e.ProgressPercentage); progressBar1.Maximum = ...Show All
JohnDB Delete Access Denied!!
I'm using the codes below trying to delete files and I got an error that say I'm trying to delete a file that still being used by another process. Please help me how to check which files are being use and skip over that and delete everything else. Here is my code so far, thanks in advance. foreach (DirectoryInfo Dinfo in dirInfo.GetDirectories( "*" )) { foreach (FileInfo file in Dinfo.GetFiles( "*.*" )) { try { file.Delete(); } catch (FileNotFoundException e) { Console .Write(e.FileName.ToString()); } } } Thanks Jason ...Show All
Deepa7476 CS0021: Cannot apply indexing with [] to an expression of type 'object'
Compilation Error is:"CS0021: Cannot apply indexing with [] to an expression of type 'object'". How can I solve this problem I tried to change "[]" into "()", but I got another error "CS0118: System.Web.UI.WebControls.DataGridItem.DataItem' denotes a 'property' where a 'method' was expected" Line 74:<ASP:Templatecolumn HeaderText="Article Title"> Line 75: <itemTemplate> Line 76: <a href=articleupdate.aspx articleid=<%#Container.DataItem["articleid"]%>&colid=<%#Container.DataItem["colid"]%>><%#Container.DataItem["subject"]%></a> Line 77: </itemTemplate> Line 78:</ASP:Templatecolumn& ...Show All
Tim Hatcher Detection of Windows-Version
Hi, I'm writing a class, whitch detects the Version of the installed Windows. On the MSDN, I found this link: http://msdn.microsoft.com/library/default.asp url=/library/en-us/sysinfo/base/getting_the_system_version.asp This works good, but I need more information. How can I detect the different WindowsXP Media Center Versions (2002,2004,2005) How can I detect the WindowsXP Edition N-versions Can anyone give me some information about this Thanks. Andre I have been trying to find an answer for you on this with what information I could gleam online short of pirating a copy of XP N and manually checking it’s version #’s to see if they differ from a stock XP install. The only useful information I’ve been able to find is this U ...Show All
RobDude How to use IME(Input Method Editor) in C#?
Hello friends, I want to develop a web application in ASP.Net using C#, in which, we provide a facility to the user to choose any one Indian Language from a drop down list and after that able to enter language specific character. So, plz, help me how to develop such kind of application Can you provide source code for IME (Input Method Editor) that I can integrate it Jitendra Kumar Mehta Here is what you have to do: Host a Windows Forms control in Internet Explorer System.Windows.Forms.Control has a property ImeMode Whether or not this will work at all from within the browser I can't tell but that's what prototyping is for. ...Show All
