Answer Questions
wesky Testing my C#.NET application
Hi, I have finished writing my application using C#.NET. Now I want to see if it is robust enough for public usage. Are there some generic rules for testing applications and for coming up with an overall testing strategy Some guidance will be extremely helpful. Thanks.. NUnit is a pretty good testing tool. The general strategy is things like doing the complete opposite, things like giving incorrect values to a method or some operation - what happens can it handle it does it handle it correctly Does it recover from this incorrect value being passed Test things between and over the border lines, example if you have an input box that can only accept numbers between 1 and 4, what happens if you ente ...Show All
baskark getting data from rfid - reader
hello! how can i get data from rfid reader, which is in rs232 - port when reader reads the tag, tags ID should get to Windows form. my code opens the serial port, but what then You must create an instance of the serial port then initialise it // For Example SerialPort mySerial = new SerialPort("COM1", 921600, Parity.none); // then you open it mySerial.Open(); // then you send or read data to buffers that you create and name write_buff or read_buff mySerial.Read(read_buff, 8); // then you close mySerial.Close(); I have a similar question. Here is the scenario. On a client application ( C#) 1. I need to connect to an RFID reader thro IP Address and Port 2 ...Show All
DCollins exportin to excel from datagrid in vs2003
Hello,everyone,i think my problem is a beginner,maybe many programmers have faced this: i have a datagrid ,it shows the data from sql server,and i want to export the all data to an excel file,and open a savefiledialog to ask you where to save to: now i have put a savefiledialog and have set the filter and the default path,how can i achieve this maybe have some namesapce first or can i get the excel from the datagrid that generate from dataview. Mamush wrote: I dont know if people will Agree with me but there is an easier way to do this. first my question to you is what is you datasource. if your datasource is anything that can be serialized to ...Show All
arogan overloading == operator in c# fails checking for null values
Hi, I have developed one class called CProductInfo providing == and != operator features. I have one problem. When I use this class in my program, say CProductInfo product = null; and later, when i check for emptiness, if (product==null) it returns false as if the product instance is not empty. I tried various ways to eliminate this run-time error, but it just does not happen. Also I don't think there is use full tips on net for this. Can someone help Thanks in advance - Constantine <<<< THE BRIEF SOURCE CODE FOR CProductInfo IS BELOW >>>>> using System; using System.Data; using System.Data.SqlClient; using MyDataLibrary; namespace ProductManager2006 { public ...Show All
MON205 Best way to extract from HTMl
There are about 4 or so <br/> tags in a certain html code block that I have as a string. What is the most efficient way (I have a way right now to do it, but it seems to be slow) to get the text between the second and third of these tags ex. a<br/>b<br/>c<br/>d<br/>e How do I get "c" in the most efficient way Nope it doesnt work, it seems it only takes the first character of the string and uses that as the splitter Regex would be one way of doing it but its expensive but ideal for these type of problems. Alternatively you could do a string.split on the <br/> tags, so any values between the br tags are in the string array: string[] theItems = theTags.Split("<br/> ...Show All
Carsten Kanstrup How to code my SQL String Manipulation App in C#
I would like to know the following in regards to my other thread on how I'd possible approach doing this same thing through C#. To me it seems like more work to do this if you are like me and haven't really done client C# and mostly used to ASP.NET C# code but I might as well start, as I could use regex or whatever to strip out stuff and instert or rearrange into our new table: http://forums.microsoft.com/MSDN/showpost.aspx postid=1087366&siteid=1 So I would like advice and specifics from your experience on the following: 1) What type of C# app should I do this in, console or windows form or other and why one vs. the other 2) Ok, fine, I create #1. Now, what type of controls should I use. I plan on reading the data from a s ...Show All
xlordt 2005: Web service project stuck in Debug configuration. No Release option
Hello all, I've got 2005 solution that has many projects in it: 2 library projects, 1 win forms project, 1 deployment project, 1 web service project. The problem I'm having is that the solution is set to Release mode but the web service doesn't build in Release mode. It always builds in Debug mode. Upon investigation of the Configuration Manager, the Configuration option for the web service project only contains the option Debug (and the platform column only contains .Net). All other projects have Debug and Release in Configuration and Platform has Any CPU | <New> | <Edit> options. Has anybody seen this before Is it because the web service project doesn't have a project file I.e. isn't a web application project Anybody know h ...Show All
MellRose How to share data between instances of an application?
Hi I want to make an application which can share an object with others instances of the same application. I'm wondering which technologies I can use, samples, any thing. Thanks Hi, if you want to be able to communicate between applications you can use Remoting, in particular look up the IpcChannel on msdn to see an example of how it works. If you are able to use .Net 3.0 you might want to look into WCF (Windows Communication Framework). Mark. ...Show All
Ineedhelp123 Please specify the assembly explicitly in the type name
The type 'DocumentPage.Global' is ambiguous: it could come from assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\documentpagece15\b19d9bc2\App_Code.zxs3sy7_.DLL' or from assembly 'C:\Projectos AS\Projectos 2005\DocumentPage\bin\DocumentPage.DLL'. Please specify the assembly explicitly in the type name. How can i solve this problem Thank's! In the DocumentPage assembly, do you have a class named 'Global' If so, can you easily change it to something else The Global class is one that is automatically created as part of building a web site. It is namespaced by the name of the web site (I think). So the name of this automatically generated class would be something ...Show All
drinkwater *csv string conversion
I read a *.csv files into a string variable. I then split it into separate lines. My next task seems to convert the string values into values corresponding the elements of an XML file the values are supposed to be written to. This is an example of a line in this csv file: 14-Sep-2006, 6.44, 6.44, 6.3, 6.32, 26300, 6.32 In the XML file which is supposed to be a recipient for this string the column types are defined as: DateTime , float , float , float , float , long , float . I ran into a problem converting the first string into DateTime. Of course, I can do it an awkward way split the date 14-Sept-2006 by delimited "-", etc, etc. Is there a standard built in class or function that can do it Another question pertain ...Show All
CodeHaxor File.Move(string1, string2) error
System.NotSupportedException was unhandled Message="The given path's format is not supported." Source="mscorlib" StackTrace: at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath) at System.IO.F ...Show All
John Cogan Get string length in pixels
How can I get the string length in pixels, base on qty of characters, font type and font size thanks in advance for your help, Edward Here is a link: Graphics.MeasureString Method Some background info: GDI+ Text, Resolution Independence, and Rendering Methods ...Show All
Gib20055 Identify Serial ports
Hi , I write an application in C# 2003. this program should list all the available serial ports on the computer and display it for the user. I tried with MSComm and AXMSComm to identify the Serial ports. But this components have only a function by the name of “commport” that return the index of one port to be used. Is there any way to identify all the serial ports and theirs name Thanks for your help /Babak If you are running v2 then the SerialPort class will give you the list of ports. For pre-v2 you can use WMI to get the ports. The Win32_SerialPort class defines a serial port. Query for all of them to get the entire list. For more information on using WMI refer to MSDN and search the forums. It is a pop ...Show All
VS_BS meta tags using master pages
I'm using master pages for a commercial web site. However we can't change the meta tags for the content pages. This is our master page: <% @ Master Language ="C#" AutoEventWireup ="true" CodeFile ="~/MainSite.master.cs" Inherits ="MainSite" %> < head runat ="server"> < title >My title </ title > < meta http-equiv ="Content-Type" content ="text/html; charset=ISO-8859-1" /> < meta name ="description" content ="description" id ="description" runat ="server" /> I want to change the meta tag description at run-time like: Page_Load description.Attributes[& ...Show All
Tom Sapp Do I need to implement Dispose() if my C# app uses Excel?
I have a dialog box that uses Excel in a background worker thread. My code is something like: Excel. Application excelApp = new Excel.Application (); excelApp.Workbooks.Add("c:/test/mybook.xls"); // do some stuff... excelApp.ActiveWorkbook.Close(true, Type.Missing, false); When the thread completes, and I close the app, everything seems to behave well, and in Task Manager, I can see that the Excel process ends. However, the information I've read indicates that I need to implement Dispose() if my managed code uses unmanaged objects. Since I'm using Excel, is that the case here Do I need to do some cleanup in Dispose() Actually, Excel seems to close just fine. At least in Ta ...Show All
