Answer Questions
Herru Perdana Problem Binding to a PK GUID Column
I have a WIN form that was working just fine when my primary keys (about 10 tables in the project) were Integer data types. I converted the PK fields to GUIDs and updated the DataSet and resulting code. I created new fields and propagated the new GUID data properly in the tables. I have a form with a list (combo box) that displays an ordered set of records, when a user clicks on one of the records, the form displays detail data using binding. This form was working fine. Now that I have converted to a GUID PK, I am getting an error when clicking on a record to display. The error message is as follows: "Column 'NoteID' is constrained to be unique. Value ..... is already present. " NoteID is the field I changed to be a ...Show All
Cappy Popp Sharing a common data set schema for multiple web services
Hi, I have a solution with multiple web services that share the same typed dataset. Each time I add a reference to a web service to a client application it creates a new web refrence class that includes an imported version of the XSD for the typed dataset. Each web service reference then has its own typed data set class . Even though the dataset is the same each web service reference refers to it via a different namespace. How do I get the web service refrences to share a common reference to the data set schema so that they all use the same type -- David Worthington .Net Framework V2.0 added a functionality to solve this problem. wsdl.exe tool has new switch (/shareTypes) allowing for type sharing betw ...Show All
RajLakamana How to perform a case insensitive filter when the DataTable has CaseSensitive=True
I have a grid bound to a DataView. The underlying DataTable has case sensitivity turned on because the SQL 2005 database uses the Latin1_General_BIN (case sensitive) collation. When I build a RowFilter expression using LIKE, it is treated as case sensitive, but I want to be able to do case insensitive filtering. I experimented using a ">=" AND "<" expression, but then I lose wild card capability and I can't use that approach if I want to find all rows with data greater than (or less than, etc) a specified string. Any suggestions will be appreciated. Thanks in advance. I revisited that and I could avoid the exception by turning off AllowAddNew, AllowDelete and AllowUpdate before changing CaseSensitive. ...Show All
Thiru_ Validating XmlDocument on the fly
Hello,Sorry for what is probably a very basic question: I am trying to validate XmlDocument objects against XSD templates on the fly. This is working fine when I load the XML in from an external file, but not when I write it in on the fly (It always validates successfully, regardless of what dummy values I use!). Anyone know why Here is the code: // create the xml and call the validator static void Main(string[] args) { XmlDocument doc = new XmlDocument(); XmlNode declareNode = doc.CreateNode(XmlNodeType.XmlDeclaration, "", ""); doc.AppendChild(declareNode); XmlElement root = doc.CreateElement("product"); XmlAttribute attr = doc.CreateAttribute("xmlns&q ...Show All
Littletommy writing an event with .net 2.0 failed.
Hi, I have a windows service and it needs to write events on a log. public static void Initialize() { try { if (! EventLog .SourceExists(eventSource)) { EventLog .CreateEventSource( new EventSourceCreationData (eventSource, logName)); } eventLogger.EntryWritten += new EntryWrittenEventHandler (eventLogger_EntryWritten); if (eventLogger == null ) { eventLogger = new EventLog (); } //eventLogger.Log = logName; eventLogger.Source = eventSource; initiated = true ; } catch ( Exception ex) { Debug .WriteLine(ex.Message); throw new Exception ( "EventLog haz rlanamad !\nKay tlar tutulamayacak." , ex); } } public static vo ...Show All
EWoodruff A design problem
Hello, I'm currently writing a part of an application which must translate a sequence of bytes (read from a network connection) according to its structure. The whole sequence is considered as a unique value, except for the first 2 bytes which identify the type of the value (numeric, string, or structured), and how the value should be parsed (the value itself can eventually be a list of values). I was thinking of inheriting from System.IO.BinaryReader for the parser (using a System.IO.MemoryStream for the byte sequence), having an abstract base class for the sequence content representation (class ContentBase), and different concrete classes which inherit from ContentBase (for example ContentInteger, ContentString, ContentListString, etc). H ...Show All
joegeiger how to format a number to string using "coma" 1000s
I have a float number 1234555.89 and I need to put in a textbox. How can I convert to string with comas like: 1,234,555.89 and add to text property. thanks in advance for your help, Edward the following code solves your problem textBox1.Text = String.Format("{0:#,###.00}", 1234555.89 ); Hi Edward, For converting a numeric value to a specially formatted string, you can use the ToString() Method. It is overloaded and takes in either and instance of IFormatProvider or simply a format string or both. For example; float val = 345653.3F; Console .WriteLine(val.ToString( "#,#.#" )); Will display 345,653.3 For more details check the following links http://m ...Show All
ICW Calculated column
Hi Folks, I have a calculated column in a dataset in my VB 2005 app (added to data set, but not in database) that uses values from 2 other columns multiplyed, and displays that number for the user. Quantity(dec, 18) * Rate(dec,18) = caluculated column 'Total' (dec,18) When ever the user places a decimal number in the quantity column, the value rounds up to the next whole number -- I do not want the number round to the next whole, and also need to limit the results to 2 decimal places. I first thought this was a control problem in a data grid -- it wasn't; I tried seperate text box controls, but with the same results - numbers round up to the next whole. The only other place I could have this problem is in the data set calculate ...Show All
ennisb VPN VB Win XP
Ref: VB, Win XP, VPN How do I approach this problem I would like to develop a Window Forms Client Side application (MyApp) that will: 1) Button click on MyApp will open Netscape and Conntivity applications. Ensure that Connitivity is always on top. 2) User must enter id and password into Conntivity app to establish VPN connection. 3) MyApp will automatically capture the event that a VPN connection has been establish, enter a URL into Netscape and execute it. I would appreciate any ideas Thanks. Currrently the VPN / RAS is not supported in managed code Thanks, Bunk ...Show All
Vikas Rao pooling large objects
Hi, I need to know how can I pool a large object , since I have a few memory (only 512 RAM) and need to allocate a large arraylist in it. help me please , Thanks in advance, Aya. Ok,thanks. I already have sent it in the following thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1241612&SiteID=1 Aya. Hi Aya See this MSDN article on memory management, including pooling objects: http://msdn.microsoft.com/msdnmag/issues/05/01/memoryoptimization/#S3 or this Code Project page: http://www.codeproject.com/useritems/objectpool.asp Hope that helps -Chris Hi Aya Since this is ...Show All
Kevin Tough Help with TripleDES and RC2 cryptography.
I have 2 questions - 1) I get the following Exception when I try to decrypt data using TripleDES. - "An unhandled exception of type 'System.Security.Cryptography.CryptographicException' occurred in mscorlib.dll Additional information: Specified initialization vector (IV) does not match the block size for this algorithm." How do I make things right The code is as follows - /* Provides TripleDES encryption and decryption using classes in the .net Framework 1.1 */ public class TripleDES_Cryptography { public static string Encrypt(string plaintext, string key, string IV) { TripleDES des3 = new TripleDESCryptoServiceProvider(); des3.Mode = CipherMode.CBC; byte[] by_plaintext = Encoding.ASCII.Ge ...Show All
victu Handle simultaneous access to database
I am making an application which will be running on serval pcs and access same database simultaneously. It makes more than one database access at a time on any single pc. I need one of the access thread to get data from a data resouce and write the new data into the database to replace the old one. when this thread is getting and writing data to my database for an item, other threads accessing that item must wait till it finishes writing. The accessing threads are generated at runtime and the number of them is vary from time to time. The pcs do not have knowledge to each other and there isn't any other machine or application working as a center to control the database access. The pcs probably will work on the same network. but, th ...Show All
JIM.H. .Net 2.0 loaded 1.1 needed
On a new system I loaded Microsoft .NET Framework 2.0, now some of my applications need Microsoft .NET Framework 1.1. Of which I can not load, even after unloading 2.0. Using XP Pro SP2. Any Suggestions Ordinarily a .NET application will try to run by the same framework version as it was compiled for (provided no overrides exist) and it is strange that installing the 2.0 Framework caused your 1.1 apps to try to run in 2.0 and stop working. Have you tried reinstalling/repairing the 1.1 Framework Also worth noting is that when you have multiple versions of the framework installed and you absolutely want to have control over the framework that your app runs in (provided it is installed) you can modify the apps config ...Show All
Gabriel Lozano-Moran odd problem recognizing public classes
My Web Service has a class file in its Visual Studio 2005 project containing several classes I wish to be available to consumers of my service. All of the classes are public and they include only primitive data types and strings... and yet one of the classes (call it N) isn't recognized when other .NET projects try to add my service as a web reference. N is recognized and used within the Service itself just fine. Changes to the other public classes show up when the web reference is updated. But, new classes added to the class file aren't recognized either. I found that the WSDL and Reference.vb files in the consumer project don't include N or any newly defined classes. I could always manually change these files for the sake of getting my t ...Show All
Luispekos [[ Strong name validation failed for assembly ]]
First of all, I am sorry for posting this two times. I have posted this in MSDN Forums Visual C# Visual C# General but it seems that no body is interested in this subject or i have posted in the wrong forum. I have used ExeShield to protect my application. ( http://www.exeshield.com/ ) - There is no problem when i try to protect Application writen in C# .NET 1.1 - But when i try to protect Application writen in C# .NET 2.0 i get this error Strong name validation failed for assembly 'c:\lab\xshld875.tmp'. The file may have been tampered with or it was partially signed but not fully signed with the correct private key. Any help on how to disable the Strong Name Validation Kind Regards ...Show All
