-
- how to compress and encrypt files
by sowmithrii
- 2 Replies
- Last post
by sowmithrii
- Do anyone know how to compress files of any format like a win zip and encrypt them from others accessing. what are the namespaces used for this purpose.....and how they are implemented and one more question is.., how a winzip compresses files thanks Naveen
-
- Longest Match
by Jake52
- 2 Replies
- Last post
by tonn
- Hi,
I have a string and i want to replace all the newlines with ";"
but if i have 2 newlines behind each other i still want just one ";"
How do i do this.
This doesn't work:
string test = Regex .Replace(paramValues, Environment .NewLine + "*" , ";" );
Thx
-
- get data after running an sql command.
by IMBack
- 7 Replies
- Last post
by IMBack
- Hi,
I am executing a select sql statement and i want to retrieve the data. Since i am just retrieving one column, I dont want to put it into a dataSet, so than I found I can do it using SQLDataReader, but I have to run a while loop to get the value. Is there a way to get the data without running a loop.
Here is how I am getting the value, using SqlDataReader's while loop.
-
- Version problems with OpenExeConfiguration(exePath) in System.Configuration
by Jono378
- 2 Replies
- Last post
by Jono378
- Hi,
There seems to be a discrepancy between the versions of the System.Configuration assemblies in .net 2.0.
I have version 2.0.50727.1366 and when I invoke the following code...
example = ConfigurationManager.OpenExeConfiguration("Example.config");
// Do some stuff...
example.Save();
All works well.
However, a colleague of mine has version 2.
-
- C# code to compare two xml
by Girija Shankar
- 20 Replies
- Last post
by Girija Shankar
- Hi all, i have to compare two xml. One is source XML and other is actual xml. I am writing both the xml : Source XML: < xml version="1.0" encoding="ISO-8859-1" > <Appointment> <Id> 8 </Id> <Date> 20060426 </Date> <Subject> whatever </Subject> <Place> where ever </Place> <Modtime> 182204 </Modtime&g
-
- SocketException driving me crazy:(
by SDan
- 5 Replies
- Last post
by Alan J. McFarlane
- I'm new to c#. When I try the following program (a very simple tcpserver) I get the following error msg.. Unhandled Exception: System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions at System.Net.Sockets.Socket.Listen(Int32 backlog) at MainClass.Main() This is the code.. using System; using System.Net; using System.Net.Sockets; usi
-
- IPAddress.Parse()
by Deathmench
- 1 Replies
- Last post
by rkimble
- I have an application in which I would like to extablish connections given an IP Address and Port in the form of an IPEndPoint. I have tried IPAddress.Parse(xxx.xxx.xxx.xxx), but I get the following error:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll
Additional information: The requested address is not valid in its context
My initial c
-
- Why Tables.Rows.Count is 0 even though rows are displayed in DataGrid
by tony19760619
- 9 Replies
- Last post
by tony19760619
- 1. I have a webforms application. 2. I am checking the number of rows is higher than 0 if (DataSet1.Tables(0).Rows.Count() > 0) 3. The value is always 0 even though I have retrieved rows from this DataTable into my DataGrid. Any Ideas Please help..
-
- Displaying element problem
by dannyg_uk
- 3 Replies
- Last post
by Martin Honnen
- Hi
I am using XmlTextWriter to create an xml file using c#. I am using WriteElementString to add elements. I would like to add an element that has no value as <example></example>, but I am getting just <example /> instead. Is there a way to force XmlTextWriter to use the <example></example> format
Thanks
Danny
-
- send xml file
by Chirag vm
- 3 Replies
- Last post
by Martin Honnen
- hi to all
i have one problem regarding to send xml file
i want to send xml file on port 80 thru web service
i am new in vb.net and asp.net so dont know how to send file
it urgent if have any example so please give me
-
- Renaming sub directories en masse
by Kevin S
- 2 Replies
- Last post
by Kevin S
- Hopefully this is the righ question for such a forum.
I have been asked to rename hundreds of directories in a directory structure.
The current structure is something like
00.10.12.XXXXXXXX
00.10.12.01XXXXXXXX
00.10.12.02XXXXXXXX
00.11.17.XXXXXXXX
00.11.17.01XXXXXXXX
00.11.17.02XXXXXXXX
The required structure is something like
ABC.12.XXXXXXXX
-
- How to resolve an IP address in a LAN?
by Geethanga
- 5 Replies
- Last post
by Geethanga
- Hi,
I'm wrting a small chat application using TCP/IP sockets. I have four hosts in my network. IP addresses are dynamic. I want to send messages using the host names.
For this i tried to use Dns.Resolve() methods. I couldn't get the result. My LAN doesn't have DNS server running.
So the i tried to use NetBIOS commands. I heard that NetBIOS is used where DNS is not available. But the probl
-
- Puzzled by performance charactersitcs
by pkr2000
- 5 Replies
- Last post
by pkr2000
- I've written a very simple program to test loading an assembly from a database, invoking a method (which tight loops to a large number). Now I run this on a number of threads but I get results that I can't concretely explain. To make things easy I've simplified the timings. 1 thread takes 10 seconds 2 threads take 13s each 3 threads take 17s each 4 threads take 20s each PS. I've tried loading the
-
- Microsoft.JScript.Vsa.VsaEngine
by rpansini
- 18 Replies
- Last post
by rpansini
- I have a simple function:
public static string EvalJScript( string JScript) { return Microsoft.JScript. Eval .JScriptEvaluate(JScript, Microsoft.JScript.Vsa. VsaEngine .CreateEngine()).ToString(); }
that is used all over my .NET 1.1 application and am currently porting over to .NET 2.0. What is the working replacement for this code I found
-
- Computing CRC16?
by billru44
- 4 Replies
- Last post
by nobugz
- Hi,
Are there any built in classes to get a checksum using CRC16 If not, can anyone give me a guide how to compute it I see 'the CRC polynomial' is x16 + x12 + x5 + 1.... but how do you apply that to a series of bytes such as:
FF A4 A6
Thanks!
-
- IPC remoting exception with events
by badhras
- 6 Replies
- Last post
by badhras
- I get an exception thrown when a remoted object tries to fire an event.
ExceptionText = "This remoting proxy has no channel sink which means either the server has no registered server channels that are listening, or this application has no suitable client channel to talk to the server."
From what I've read so far, I'm doing something wrong in the configuration, but I obviously don'
-
- Connection String in Client / Server Application, Strong typed Dataset
by Spenceee
- 14 Replies
- Last post
by SobyOne
- Sorry bout the subject, but it is my conundrum.
I have a solution (C#) that is fat clients (winforms) talking to a database (SQL Server 2005).
Our solution uses a strong typed dataset for all of its operation for the various benefits gained therein. I have used untyped solutions, and when you write the dataadapters, its very easy to customise the connection string. However strong typed,
-
- Interop troubles with excel
by GraemeP
- 10 Replies
- Last post
by GraemeP
- I asked this in the VB forum, but think it is more suited here. My application (VS2005) uses the interop assembly 11.0 to communicate with excel.
11.0 is the version for excel 2003. When I put the application on a client machine, it's fine provided the user has excel 2003 and either the PIAs are installed, or I distribute the dlls with my application.
However, I've just tried this on a machi
-
- concurrent database insertions
by Priyan R
- 2 Replies
- Last post
by Robert Rossney
- A .net application accessing from multiple users at the same time. I have a invoice number its generated from th last invoice number in .net code. ie, the last invoice number is selected from sql server, and performed calculations in .net , for the next invoice number. And inserted the new record in database with the generated invoce number. The problem is if multiple users gerate invoice number a
-
- Finding default namespace prefix
by sush83
- 2 Replies
- Last post
by Martin Honnen
- hi all I have a scenario. I have a word template formed using schema mappings. I am getting data xml based on that schema from other source. I have to merge the template xml and data xml to form the final word document. To acheive this I have a base xsl which transforms template xml to create an intermediate xsl which has the data elements. During the transformation i set the namespace parameter p
-
- SyncLock: Any benefit or downside to using a ReadOnly Shared Var as lockobject?
by salafa
- 1 Replies
- Last post
by Greg Beech
- Public NotInheritable Class Foo Private Shared ReadOnly _LockMe As New Object() Private _MyObject as MyObject Public Sub Run() Me._MyObject = New MyObject() SyncLock _LockMe Me._MyObject.MyProperty = 3 End SyncLock End Sub End Class Given the above example, are the any benefits, downsides, gotchas to using a ReadOnly Shared var as a lockobject Or will it
-
- How to Update 2 tables in 1 DataTable
by SomeBD
- 9 Replies
- Last post
by Derek Smyth
- i have create method like below method Save() {
transaction a
SaveA(a); // insert SaveB(a); // not insert } method SaveA(Transaction a) {
// code here DA.Update(this); } method SaveB(Transaction b) {
// code here DA.Update(this); } i don't know why SaveB(a) don't insert data into database (i try to debug and it process DA.Update(this) . SaveB is correct, i have comment SaveA(a); then
-
- Linking two DataSet instances
by RMD
- 5 Replies
- Last post
by Andreas Johansson
- Imagine that you have a dataset that contains a large number of tables. The data in these tables, which comes from a SQL Server database, is fairly static so you simply cache an instance of that dataset in memory and grab it when you need some data from those tables. This works great because it's fast (thanks to caching), and it gives you access to related data via the relationships defined in the
-
- Command Parameters !
by RDH123
- 1 Replies
- Last post
by Bill Lin - MSFT
-
- serial port in Visual C# (send and receive data)
by garincha
- 3 Replies
- Last post
by garincha
- Hi,
i need some advice.
i'm PLC developer, so i don't know a lot of programming in Visual C#, only a basic of VC#. i have one PLC and i want to communicate with PC,precisely i send some data from PLC to the serial port of PC. I was programming PLC to send some data and in Console application of C#, i receive that data. it's all O.K!!
but, in Windows application i can't receive any data.