Software Development Network Logo
  • SharePoint Products
  • Audio and Video
  • Visual C++
  • IE Development
  • VS Team System
  • .NET Development
  • Visual FoxPro
  • Smart Devicet
  • Visual C#
  • Game Technologies
  • Windows Vista
  • Visual Studio
  • Windows Forms
  • Microsoft ISV
  • SQL Server

Software Development Network >> .NET Development

.NET Development

New Question

insert rows from datagrid into database
DW20.exe - using up all cpu
Problem reading no updated data.
BitArray MyProblem Or Bug ?
Regular Expression
OutOfMemoryException when calling Assembly.ReflectionOnlyLoadFrom on large assembly.
Parse received XML
FileSystemWatcher event not raised when mailserver moves file
ICDType <-> MD Type signatures
help needed in pixel operation

Top Answerers

VBtje
fiatlux
NP Rudra
Daniel.K
never_again
Steve Bostedor
Tort
Tom_Liu
Mateusz Rajca
David Fletcher
ECatsBridge
Only Title

Answer Questions

  • TMF Question about COM-Interop.

    Hi, I have written a COM-Server (InProcServer32, Dll) that I'd like to use with .NET (The server contains some API-wrappers, that cannot be easily accessed via P/Invoke). To test my server, I have created a C#-Project and included a reference to my server. VS2005 has correctly created a Wrapper-Dll from the type-library. But when I try to create an instance of the CoClass in question, I receive a COMException with a HRESULT of 0x80040154 REGDB_E_CLASSNOTREG, means that the class is not properly registered! But the class IS registered! I have checked the registry and have also tested the server with an "unmanaged" C++-Client before! Anyone out there who can help me Thanks in advance Reiner ...Show All

  • abhishek_6023 io serial port and withevents in a class

    Hi, I have the following class, that i need to handle the serialport event see note below Imports System.IO Public Class Class1 Dim WithEvents serialport As New IO.Ports.SerialPort Function GetWeight() As String Dim ReturnData As String = 0 If Serialport.IsOpen Then Serialport.Close() End If Try With Serialport .PortName = "COM1" .BaudRate = 1200 .Parity = IO.Ports.Parity.Even .DataBits = 7 .StopBits = IO.Ports.StopBits.One .Handshake = IO.Ports.Handshake.XOnXOff .WriteTimeout = 5 End With Serialport.Open() Catch ex As Exception Return ex.ToString Exit Function End Try Try Serialport.W ...Show All

  • sagebrushsag Inteface with Smart Card reader

    Hi i m working on small project . In my project i have to interface with smart card .I m doing my project in C# 2005 . But i dont know how to program with Smart Card reader.how to read and write to Smart Card. Help me http://pinvoke.net/default.aspx/winscard.ASCIIEncoding http://www.codeproject.com/smartclient/SmartcardFmwk.asp Try Changing the Charset.Auto to Unicode or ascii (just try it solved an issue for me once) Contact the manufacturer of the reader and ask them for the protocol specification. Then use the .NET 2.0 SerialPort class to read the data. I too am doing similar work utilizing smart card reading integration into a .Net C# application. My particular scena ...Show All

  • Alex Yakhnin - MSFT Recieving error when using XmlSerializer

    Below is the code I am using. ** My Item.CS class that contains the methods and variables used by most of the items. public class Item { private int mItemCost = 0; private int mItemResell = 0; public int ItemCost { get { return mItemCost; } set { mItemCost = value ; } } public int ItemResellValue { get { return mItemResell; } set { mItemResell = value ; } } public void Save( string filePath) { if (!filePath.EndsWith( "\\" )) filePath += "\\" ; System.IO. Stream stream = File .Create(filePath + ItemFilename); XmlSerializer serializer = new XmlSerializer ( typeof ( It ...Show All

  • Gr&amp;#38;&amp;#35;233&amp;#59;gory Leandro Thread.Abort()

    I know a lot has been said about this method and I am of the firm belief that calling this method or designing my applications around this method (for clean up work) is just plain old evil. Anyway, I was wondering what would happen if the method were to be called from the worker thread itself, and the not the parent thread So something on the lines of: try { Thread doWork = new Thread(new ThreadStart(ProcessData)); doWork.IsBacground = true; doWork.Start( ); } catch (Exception) { } protected void ProcessData( ) { try { // Do Work } catch {Exception e } finally { try { Thread.CurrentThread.Abort( ) } catch (Exception) { // Do Nothing } } } My intuition tells me that this model is evil, but my mind tells me that there is nothing wrong with t ...Show All

  • Veera.c How to update an element's value?

    I am building an xml file in SQL Server 2005 (SSIS). The problem is that one of the first element that is written I won't know the value until I have processed all of the records. So I was wondering if there is a way to open up the file that was generated and update the element named "DeclaredValue" Thanks. Have a look at XmlDocument and it's ReplaceChild method... If you want to edit an XML document then with .NET DOM/System.Xml.XmlDocument is a tool to do that e.g. XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(@"file.xml"); XmlElement declaredValue = xmlDocument.SelectSingleNode(@"//DeclaredValue") as XmlElement; if (declaredValue != null ...Show All

  • Akil saving xpath document

    public void EditAnnouncement( int intAnnID, string strAnnTitle, string strAnnBody) { XPathDocument annDoc = new XPathDocument ( "Announcement.xml" ); XPathNavigator annNavigator = annDoc.CreateNavigator(); XPathNodeIterator nodes = annNavigator.SelectDescendants( "ann" , "" , false ); XPathExpression expression = annNavigator.Compile( "//annPanel/ann/annID=intAnnID" ); if (annNavigator.Matches( "expression" )) { //////////////////////// in here is code true for my editing issue nodes.Current.MoveToChild( "annTitle" , "" ); (is this annTitle which id is same user sent; for example user sent to id= 1 is this child in sam ...Show All

  • Cato1969 how to write a query to get the columnNames from Excel.

    hi, Is it possible to get the column names of an Excel spreadsheet.I am using oledbCommand object. OleDbConnection SampleDataSourceCon = new OleDbConnection(); SampleDataSourceCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:/SampleDataSource.xls;" + "Extended Properties="+ Convert.ToChar(34).ToString()+ "Excel 8.0;HDR=YES;IMEX=1"+Convert.ToChar(34).ToString(); SampleDataSourceCon.Open(); OleDbCommand SampleDataSourceCmd = new OleDbCommand(); SampleDataSourceCmd.CommandText = "Select * FROM [Sheet1$]"; SampleDataSourceCmd.CommandType = CommandType.Text; SampleDataSourceCmd.Connection = SampleDataSourceCon; OleDbDataAdapt ...Show All

  • dydoria About the finalizer thread and thread-safety

    I'm using C++/CLI. I have some classes that control some native resources (objects from an unmanaged 3rd library). In the finalizer, before deleting the native objects, I need to call a native method of the library to "de-attach" them (remove them from a list, etc.). The problem is that this library is not thread-safe and, since finalization happens on a separate thread, it's my understanding that random crashes may happen during the lifetime of the application. Is this correct Is there a way to have the finalization thread blocked/not executed when execution is inside unmanaged context (or have finalization at the same thread as the application's ) Is requiring from the user to call Dispose the only solution for cleaning up resources, in ...Show All

  • Wayne Pfeffer How to copy a file to a folder shared on the network

    I am generating a zip file then I have to move it to a folder shared on one of the system in the network. How Can I to move a folder into shared folder on one of the system in the network in C# .net 2.0 You mean that you only have share permissions Then there is no way to force it. Otherwise it would be a major security leak. Greetz, Geert Geert Verhoeven Consultant @ Ausy Belgium My Personal Blog The following line moves a file from C:\test.txt to \\LP51\c$\Test\test.txt . System.IO. File .Move( @"c:\test.txt" , @"\\lp51\c$\test\test.txt" ); NOTE: Make sure you have write permissions on NTFS level as well on Share level. Greetz, Geert Geert Verhoeven Co ...Show All

  • Nevbelethiel Compile and Build Project from command line or programatically

    I want to compile one c# project (.dll library) from another c# program. Now I want to run another program (from the same program that compiled the library) that makes use of the .dll library that was compiled. Will I have to recompile that program using the new .dll as well or can I just set a reference to the new .dll in some way Yes, it is possible to dynamically load a dll into a host application. Typically this is done by defining an interface or abstract base class (ABC) in the host, then implementing it in the dynamic dll. The host uses reflection to find and load the class(es). See the System.Reflection.Assembly methods Load, LoadFrom and GetTypes. The host activates the types and calls into them ...Show All

  • sanwanas XML Serialization of custom collections

    Say you have a class Person with the following members: class Person { public string FirstName; public string LastName; public string SSNumber; } and a custom collection (not sure if this code works, it's just to give you an idea of what I'm doing) class PeopleCollection { private Hashtable m_peopleBySS; // Person hashed by ssNumber public Person[] People { get { ArrayList people = new ArrayList(); foreach(Person p in m_peopleBySS.Values) { people.Add(p); } return (Person[])people.ToArray(typeof(Person)); } set { m_peopleBySS.Clear(); foreach(Person p in value) { m_peopleBySS[p.SSNumber] = p; } } } } and finally a class which holds a g ...Show All

  • cgraus Cannot open an xml resource file in C# VS2005 project

    This C# code is used to open an xml source file. DataSet ds = new DataSet(); System.IO.Stream file = Assembly.GetExecutingAssembly ( ).GetManifestResourceStream ( "NPlot.asx_jbh.xml" ); ds.ReadXml( file, System.Data.XmlReadMode.ReadSchema ); DataTable dt = ds.Tables[0]; <= error here I am wondering perhaps the mishap is due to the old version of xml used. These are the first four lines of that file: < xml version = " 1.0 " standalone = " yes " > < NewDataSet > < xs:schema id = " NewDataSet " xmlns = "" xmlns:xs = " http://www.w3.org/2001/XMLSchema " xmlns:msdata = " urn:schemas-microsoft-com:xml-msdata " > & ...Show All

  • dotHuman Save and Load with XML

    Hi. I have made a Web Browser With a favourite menu and it all works except for one function. I have a function to save the favourites list when the browser closes and another to load the list when it opens. THe thing is niether of the two functions run. When I close the browser then open it again the favourites haven't saved any ideas Code; Save Function; public void DoSaveFavourites() { //serialize Type[] theTypes = new Type[1]; Type[] theTypes = new Type[1]; theTypes[0] = typeof(List<Favourite>); XmlSerializer theSerializer = new XmlSerializer(typeof(Favourite), theTypes); System.IO.StreamWriter theWriter = new System.IO.StreamWriter(System.Windows.Forms.Application.StartupPath + "\\f ...Show All

  • creaturita Security for new serial port class

    Does anyone know what permission is needed to use the System.IO.Ports class eg. SecurityPermission sx = new SecurityPermission ( SecurityPermissionFlag .Execution); In other words What SecurityPermission is needed I am trying to build a WinForm control to run in a browser. Thanks in advance. PatC And the magic trick IS !!! After one week and several hundred compile roundtrips .... Drum roll .... [SuppressUnmanagedCodeSecurityAttribute()] put this in the namespace of the class that you are calling from the web page. Then do a SecurityPermission sx = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); sx.Assert(); you can then access the serial ...Show All

464748495051525354555657585960616263

©2008 Software Development Network

powered by phorum