|
Yup, that's possible. Take a look at this article[^] for an example
I are troll
|
|
|
|
|
I m designing a utility to ping a range of IP addresses on C#,I know how to send ping to an IP address.The problem is that i am unable to design a loop with dotted decimal notation which will send pings to all machines between "FROM_IP_ADDRESS" to "TO_IP_ADDRESS". Help...
(what i m trying to do is to convert the address to long,but this doesn't help too.
|
|
|
|
|
For this to work, you can either break up the addresses into individual bytes with logical operators, or you can write your own code to jump from 255 to 0 and increment the next group.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Ya i had that in my mind...............
but i donno why i was reluctant to do that.... :
anyways.........thanx
|
|
|
|
|
Anyone can provide c# sample project? i need a complicated one for vsts 2008 unit testing.
Thanks for help!
|
|
|
|
|
Have you looked around this site at ALL ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Add whatever complexity you need to this
class Program
{
static void Main()
{
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I hope you started with a full requirements analysis for this.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hello evryone,
i m trying to do one demo for improt excal into datagrid view using C#,.NET2005.
will you please send any demo related to this kind of thing.and code for it....
thanks in Advance
Naim Khan
|
|
|
|
|
I assume it's because you cannot spell that google is not working for you. Try 'import excel C# datagrid' instead of 'improt excal C# datagrid' and google will be more helpful.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Here i upload the excel file in datagrid
private void button1_Click_1(object sender, EventArgs e)
{
OpenFileDialog FD = new OpenFileDialog();
FD.Filter = "Excel|*.xls";
if (FD.ShowDialog() == DialogResult.OK)
{
textBox1.Text = " " + FD.FileName;
}
string filename = textBox1.Text;
String connectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
OleDbCommand selectCommand = new OleDbCommand("SELECT * FROM [mybook$]", connection);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
dataAdapter.SelectCommand = selectCommand;
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
System.Data.DataTable dataTable = dataSet.Tables[0];
dataGridView1.DataSource = dataSet.Tables[0];
MessageBox.Show(dataGridView1.RowCount.ToString());
connection.Close();
}
it may help you
modified on Monday, April 27, 2009 6:15 AM
|
|
|
|
|
I am currently building an application which will deal with several large sets of data from different sources such as databases, csv & xls files. I have been looking at the dis/advantages of using dataset & generic collections.
My conclusion was that I would need to use generic collections because I will be dealing with ~ 300,000 records in most cases (they will not usually be displayed to the user). I have not really delved into generic collections before and I am having trouble figuring the best way to construct the class because each set of data will have a different amount fields but I want to be able to use the same methods to sort, search & filter.
Would the below basis for a class work, is there a better way? I am having trouble thinking how the sorting would work with this, whilst it seems very easy when the class is not made up with an array.
public class Record
{
private string[] cells;
public string[] Cells
{
get { return cells; }
set { cells = value; }
}
|
|
|
|
|
Don't use an array, for exactly the reasons you stated. Use a generic collection, like a List. The list classes have sorting methods built in.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
How do I deal with multiple columns for each record?
List<int> is fine for a list such as 1,4,5,3,2,5 but how would you deal with {5,6,7} {3,5,1} {8,9,1} and it be able to deal with other size sets, for example one with 12 fields per record?
Thank you
|
|
|
|
|
Create a struct for each set which will both name the fields, and group them together.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi all,
I'm using c# in VS 2008, I just found out a single '\r' could be used a new line control code, why's that considering '\r' is to move the position of the cursor to the first position on the same line? Isn't '\r\n' supposed to do that?
Thanks,
modified on Monday, April 27, 2009 4:10 AM
|
|
|
|
|
|
The newline character is a system dependent mix of the carriage return (\r) and line feed (\n) characters. On Unix newline is \n, on Macs newline is \r and on Windows newline is \r\n. If you're using .Net then you should be using Environment.NewLine instead of a specific character sequence.
|
|
|
|
|
Hi friends
can anybody help me to create MDI application using C#.Net 2008
In advance thanks
|
|
|
|
|
So you know how to create MDI applications in the previous versions???
If yes, VS 2008 makes no difference, only with some added features...
Try to search the code project articles on MDI applications....
This would be a better start
Windows Form programming.[^]
Have a Happy Coding.....
|
|
|
|
|
Hi,
I'm trying to read connection string from app.config in .net 3.5, as below
string con = ConfigurationSettings.AppSettings["DBConn"];
But, its not working.
App.config file
===============
<configuration>
<configsections>
<connectionstrings>
<add name="DBConn" connectionstring="Data Source=LALITHA\SQLEXPRESS;Initial Catalog=GSM;Integrated Security=True">
providerName="System.Data.SqlClient" />
Please let me know how to read. Thanks in advance.
|
|
|
|
|
|
Hi there,
I want to change the default Home page of the IE browser using C# console application. For this purpose, I have to manipulate the registry settings. The registry path for doing so is: HKCU\Software\Microsoft\Internet Explorer\Main\Start Page.
Now, suppose the start page (home page) of the browser is set to http://google.com. Then how will I programatically change it to http://msn.com in C#?
Your help will be truly appreciated,
Rajdeeep.NET
|
|
|
|
|
|
Hi there,
Thanks for taking interest in my question. I am trying to create a program which will detect any removable device attached to the System and copy itself to it. Something like this:
//Pseudo code begins:
1). If G:(Removable device) contains myprogram.exe, then goto step (2)
else
Copy myprogram.exe to G:(Removable device).
2). Exit
//Pseudo code ends here
But the problem is that, how will I code the program to detect Removable devices ex. PenDrive attached to the system?
Please help,
Its really urgent,
Long Live Code Project,
Rajdeep.NET
|
|
|
|