|
a string or parameter with name s has not been initialized.
Initialize it: like this:
string s = "";
good luck.
No hurries, no worries.
|
|
|
|
|
I need to write a code that will scan/check all the ports on my system and give me details as to which one is being used and service used on it.
Pls, kindly tell me the libraries to used and the necessary/apt functions
|
|
|
|
|
A crude way is to simply iterate through the 65535 possible ports and trying to opening each one of them. The System.Net namespace and the System.Net.Tcp namespace can help you do this.
AFAIK, there is no way you can identify the service running on a port. The best you can do is guess based on the list of well known ports (HTTP on port 80, for example).
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi all,
I need to send a Message to Network computer and stop all the process in that computer using C#?
Can any one please Guide me?.
thanks in advance.
|
|
|
|
|
hi,
could any one tell me is there any class for zipping a file in c#
thanx in advance,
sachin
|
|
|
|
|
AFAIK, not in the framework, and I find nothing about it in MSDN.
I think that you have to look for an third party class. Google[^] is your friend.
---
b { font-weight: normal; }
|
|
|
|
|
Did you try using the zip component from SharpDevelop?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi to all,
i made a user control, and i was working in design mode, i have this exception :
An unhandled exception of type 'System.StackOverflowException'
occurred in mscorlib.dll
after this my solution was closed and when i try to reopen it visual studio prompt me the screen debbuger, i choose to open the debbuger but i can not work with my solution no more because when i close the debugger the solution closes with the debugger
any help please
best regards
fady
|
|
|
|
|
You have to detach the debugger from the process before you close it, or it will also close the process it is debugging.
---
b { font-weight: normal; }
|
|
|
|
|
Hello everybody,
I know that a mdi-parent should only be a container for the mdi-childs, but I want/need to get some dynamic information on the background.
I have tried to put a label on the grey parent-panel, but if I open a child, the label is still in front of the child. Also with SendToBack() and BringToTop() I had no success.
I hope, my problem is clear to you. I would appreciate if anyone can help me
Best Regards,
Kalix
|
|
|
|
|
i am doing a project using NANT, which is a build tool provided for C#.Net.
But if I want to use that I want to get the NANT.Core.dll and some other dll files. Can anybody who has the experience of using this, help me to get these .dll files. I searched it through the internet. but coudn't find a good result. Please help me.... thanks
|
|
|
|
|
i have been able to send AT commands to my gsm modem and got their response using streams.. im accessing serial communication port to connect to my gsm modem..
my problem now is when i issue the AT+CMGS="<destination number="">" command my app hangs and the modem does not respond the '>' character.. it is as if it does not end reading the stream(???).. i dont know what's the problem with this one. i run it before in .NET 2003 and it works fine. when i upgraded to .NET 2005 beta, thats the time when i started encountering this problem..
added to that.. i think the problem also is with the response of AT+CMGS="<destination number="">" command. it seems that the streamreader.readline() did not encounter an end of line or maybe an end of file(??? not sure) because i tried issuing the command in the hyperterminal and the modem's response is '>' and it waits for user input, which in this case is the message...
can anybody help me with this? thank u so much!
|
|
|
|
|
I've had a similar problem where StreamReader.ReadLine() gobbled up one too many line endings while waiting for input over a NetworkStream. I ended up writing my own ReadLine() function to solve this problem.
|
|
|
|
|
Hi all
We need to do a small application that, amongst other things, need to extract some data from a MS Access database into a MS Excel worksheet. Connecting from my C# windows application I can connect to the MS Access database and extract the necessary data using the Jet driver (Microsoft.Jet.OLEDB). I am reading the data into a OleDbDataReader.
I am not sure how to do the MS Excel part. I would like to use the Jet driver (Microsoft.Jet.OLEDB). for this too, because then I do not have to reference the Microsoft Excel COM library in my project (as far as I know).
The following type of code works to open the connection to my Excel worksheet, but how would I add the records from my OleDbDataReader into the worksheet. Possible code probably needs to be where the ”XXXXXXXXXXXXXXXX” is in the code.
private void UpdateExcel()
{
OleDbConnection cnExcel = null;
try
{
Cursor.Current = Cursors.WaitCursor;
StringBuilder sbConn = new StringBuilder();
sbConn.Append(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Stocks.XLS");
sbConn.Append(";Extended Properties=");
sbConn.Append(Convert.ToChar(34));
sbConn.Append("Excel 8.0;HDR=No;IMEX=2");
sbConn.Append(Convert.ToChar(34));
cnExcel = new OleDbConnection(sbConn.ToString());
cnExcel.Open();
OleDbCommand cmdExcel = new OleDbCommand("XXXXXXXXXXXXXXXX",cnExcel);
cmdExcel.ExecuteNonQuery();
cnExcel.Close();
Cursor.Current = Cursors.Arrow;
}
catch(Exception ex)
{
cnExcel.Close();
MessageBox.Show(ex.Message);
}
}
Alternatively is there a better, more streamlined way?? Perhaps something like the Data Transformation Services in SQL Server where I can export from Access into Excel? If there is, how could I do that from within C#?
|
|
|
|
|
Just use an 'Insert into' statement for your "XXXXX" The table name should be the worksheet name with '$" appended (SHEET1$), and the column names A, B,C etc.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Hi! Can someone please help me with the code I posted below "Save Button". I really need an expert's adice on that. Thanx! Greatly appreciated!
|
|
|
|
|
I have a question that has been touched upon in previous articles regarding calling dlls from C#.
I have a DLL that has been built in Embedded Visual C++ 4.0. I have a 'Solution' in the .Net IDE that contains a C# project. I need to be able to load and call the functions in the DLL constructed in EVC4 (real C++ - not through CLR. i.e. not managed C++ in .Net).
It would seem that the way I go about doing this is to make a proxy dll that is called from the C# project to a managed C++ project. From the managed C++ project, calls are made for the LoadLibrary, and GetProcAdress to the functions in the EVC4 dll. Am I going down the right track?
Can anybody please give me some steps about solving this problem?
|
|
|
|
|
You can use P/Invoke (see www.pinvoke.net[^]) to call native (eg. C++ or Win32) DLLs from any managed language (C# in this case.)
I don't know about a DLL created with EVC though.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Like Luis said, pinvoke is a better option if you are going to use only a few functions from the DLL and you know the DLLs you are going to use, at compile time. It's very easy to do, just declare a static extern method with the equivalent C# signature of the DLL functions, mark it with the DllImport attribute, and you are done.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi
I have some records say 1000 Nos fetched from SQL and stored in a Dataset.
Now I need to fetch and store top 1-50 records in another dataset and top 51-100 records in another dtaset and so on.
Could any one help me how to transfer records from one Dataset to another dataset?
Regards
San
|
|
|
|
|
Surely what you want is a stored procedure that pages your data ? The way to do this is to do two selects, that are nested, use the TOP statement in both, and have one ordered ASC and the other DESC. So the first grabs from the first record through to the last one you want, the other inverts the order and selects from the last one you want to the first one you want.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry My idea is to manipulate the data locally, .
My ultimate aim is to do paging in dataGrid since winform GataGrid is not supporting the Paging.
|
|
|
|
|
Really ? Only the web DataGrid does paging ? I didn't realise that.
Well, the easiest thing would still be a stored proc that takes a page number and size, but if you want to limit your database access, then I guess you'd store the full table locally, and build a datasource from it that you bind to the grid, selecting only the current page rows.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I would add a DataColumn with AutoIncrement set to true to the table, and then use a DataView and its RowFilter property to just return the records with that column from 1 to 50.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hi all,
My Question is like this:
Our network is workgroup.Then How do we Logg on to NETWORK Computer using C#?.
I need to handle a service in other computer ..but it says that "You haven't enough previleges to access this Service Control"
So I need to hardcode user name and password of that machine.So what is the method or way to logg on to NETWORK computer..?
But our NETWORK is a WORKGROUP not a Domain.
I know there is way to logg on to other computer if our computers are in a DOMAIN..
So please any one tell me how to access workgroup computer using C#?
thanks in advance.
|
|
|
|