|
i have one excel file & wants to insert that file with records in to data table???
can any one help me to do so????
|
|
|
|
|
Your question is not focused but the general structure can be as follows:
Open the file using an OleDbConnection (you can find the connection string at connectionstrings.com)
Read the contents into a DataTable using a SELECT * FROM [table_name]
Connect to the db you wish to export the data to
Create the table and columns
Write the table
Natza Mitzi
|
|
|
|
|
An easy way is to use FileHelpers. Check site www.filehelpers.com[^]
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
i design report with crystal report embedded in vs 2005. report work correctly in my computer and then i make setup for my application and run other computer but recive exeption : could not load file or assembly 'crystaldecision.windows.forms, version=10.2.3600.0,...
please help me
|
|
|
|
|
You need to include all referenced assemblies in your setup. As the exception says you are missing at least crystaldecision.windows.forms
|
|
|
|
|
Hello friends,
I have a question that is not completely about c# but it relates:
I am going to write an administrative program for a client-server network.
this program is for comminucating and sending the packets through network, from server to clients and viceversa.
but there is a question: for this kind of comminucations, c# is more respondent or java? which of these two languages is better for write the program? Is there any differences? What are them?
please guide me.
thanks
|
|
|
|
|
Hi,
Probably no one will say C# is better than Java or vice versa as you guess but I have been writing server/client applications for a long time and I can say that .NET IDE is very stable and .NET framework has good and easy to use server/client classes .
You can develop client/server applications very easily with .NET C#.
Good luck
zafer
|
|
|
|
|
thanks for your kind response,
may I know what kind of resources do you offer me to understand fundamentals, source code and rather articles. because those source codes I found are a bit difficult and half-explained.
thanks again
modified on Sunday, August 31, 2008 7:32 AM
|
|
|
|
|
I suggest you to buy "C# in a Nutshell" written by "Joseph albahari". The book explains some basics of network programming.
|
|
|
|
|
honestly, you may choose what language that you more understand to use, so you can manage them more easy and give fast response when errors occurred.
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
thanks again,
i'll be glad if you give me the resources of learning (articles and source codes ). I have searched for them but those I found are a bit difficult and malfomed explained. whould you give me some better ones?
modified on Sunday, August 31, 2008 7:39 AM
|
|
|
|
|
|
If the applications will never be run on Linux, write it in C#.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
thanks again,
i'll be glad if you give me the resources of learning (articles and source codes ). I have searched for them but those I found are a bit difficult and malfomed explained. whould you give me some better ones?
modified on Sunday, August 31, 2008 7:35 AM
|
|
|
|
|
Google is your friend.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I think Java is better and harder.
Sajjad Izadi wrote: Is there any differences?
By Java :
You can run your program on both of Linux and Windows.
Java is faster , faster , faster.
|
|
|
|
|
Mohammad Dayyan wrote: Java is faster , faster , faster.
Are you sure ?
Seriously, it all depends on the programmer and how efficiently the program is written. A C++ program can be very slow if it is written poorly.
|
|
|
|
|
what have you done before? or what have you done so far?
If you are a beginner learn from some tutorials before doing that.
Even not beginner download some samples here.
Good Luck
nelsonpaixao@yahoo.com.br
|
|
|
|
|
when we create a asymmetric key pair where can i find the public key, to distribute.
|
|
|
|
|
if i have a string like "100-A",i want to autoincrement it like 100-A,100-B,100-C......100-Z,100-AA,100-AB,100-AC......100-AZ,100-AAA,100-AAB
......
CAN ANY ONE HELP ME TO DO CODE FOR IT??
I ALREADY DONE CODE LIKE
public string autogenrate1(string strauto)
{
object max;
string m;
int count = 0;
max = ExecuteScalar(strauto);
if (max == System.DBNull.Value)
{
m = "100-A";
return m;
}
else
{
string n = Convert.ToString(max);
string character = "";
for(int t=0;t<n.length;t++)>
{
if (n[t] >= 'A' && n[t] <= 'Z')
count++;
}
if (count == 1)
{
for (int i = 0; i < n.Length; i++)
{
character = n.Substring(i, 1);
}
switch (character)
{
case "A": character = "B"; break;
case "B": character = "C"; break;
case "C": character = "D"; break;
case "D": character = "E"; break;
case "E": character = "F"; break;
case "F": character = "G"; break;
case "G": character = "H"; break;
case "H": character = "I"; break;
case "I": character = "J"; break;
case "J": character = "K"; break;
case "K": character = "L"; break;
case "L": character = "M"; break;
case "M": character = "N"; break;
case "N": character = "O"; break;
case "O": character = "P"; break;
case "P": character = "Q"; break;
case "Q": character = "R"; break;
case "R": character = "S"; break;
case "S": character = "T"; break;
case "T": character = "U"; break;
case "U": character = "V"; break;
case "V": character = "W"; break;
case "W": character = "X"; break;
case "X": character = "Y"; break;
case "Y": character = "Z"; break;
case "Z": character = "AA"; break;
case "AA": character = "BB"; break;
case "BB": character = "CC"; break;
case "CC": character = "DD"; break;
case "DD": character = "EE"; break;
case "EE": character = "FF"; break;
case "FF": character = "GG"; break;
case "GG": character = "HH"; break;
case "II": character = "JJ"; break;
case "JJ": character = "KK"; break;
case "KK": character = "LL"; break;
case "MM": character = "NN"; break;
case "NN": character = "OO"; break;
case "OO": character = "PP"; break;
case "PP": character = "QQ"; break;
case "QQ": character = "RR"; break;
case "RR": character = "SS"; break;
case "SS": character = "TT"; break;
case "TT": character = "UU"; break;
case "UU": character = "VV"; break;
case "VV": character = "WW"; break;
case "WW": character = "XX"; break;
case "XX": character = "YY"; break;
case "YY": character = "ZZ"; break;
}
}
else if (count == 2)
{
for (int i = 0; i < n.Length; i++)
{
character = n.Substring(i, 1);
}
switch (character)
{
case "A": character = "AB"; break;
case "B": character = "AC"; break;
case "C": character = "AD"; break;
case "D": character = "AE"; break;
case "E": character = "AF"; break;
case "F": character = "AG"; break;
case "G": character = "AH"; break;
case "H": character = "AI"; break;
case "I": character = "AJ"; break;
case "J": character = "AK"; break;
case "K": character = "AL"; break;
case "L": character = "AM"; break;
case "M": character = "AN"; break;
case "N": character = "AO"; break;
case "O": character = "AP"; break;
case "P": character = "AQ"; break;
case "Q": character = "AR"; break;
case "R": character = "AS"; break;
case "S": character = "AT"; break;
case "U": character = "AV"; break;
case "V": character = "AW"; break;
case "W": character = "AX"; break;
case "X": character = "AY"; break;
case "Y": character = "AZ"; break;
}
}
string s = "100" + "-" + character;
return s;
}
BUT IT CAN NOT PROCEED AFTER 100-AZ......
|
|
|
|
|
Perhaps something like this:
<br />
private int index = 0;<br />
private List<int> l = new List<int>();<br />
<br />
private void Increment()<br />
{<br />
if (l[index] == 91)<br />
{<br />
l.Add(new int());<br />
index++;<br />
}<br />
else (l[index]++)<br />
<br />
Print();<br />
}<br />
</int></int>
<br />
private void Print()<br />
{<br />
string letters = string.Empty;<br />
for (int i =0; i < l.Count; i++)<br />
{<br />
letters += (char)list[i];<br />
}<br />
string s = "100 - " + letters.ToString();<br />
}<br />
<br />
I havent tested this so you may need to tweak it.
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Check out this code project article[^]. It's a base conversion class. If you convert base 26 (letters A-Z) to base-10, increment the converted value, and then convert it back to base-26, you'll have your answer.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi All,
I'm creating a custom control that has a property of type String that takes a file path. When this property is being edited from the Properties Window I would like to open the File Dialog so the user can browse to the one they want. How can I do this?
Thanks.
|
|
|
|
|
you can try this sample code
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Design;
using System.Windows.Forms.Design;
using System.ComponentModel;
namespace testproperty
{
public class TestClass
{
public TestClass()
{
}
private int id;
[System.ComponentModel.Category("Main")]
[System.ComponentModel.DisplayName("ID of Class")]
public int Id
{
get { return id; }
set { id = value; }
}
private string fileName;
[System.ComponentModel.Category("Others")]
[System.ComponentModel.DisplayName("FileName to load")]
[BrowsableAttribute(true)]
[EditorAttribute(typeof(OpenFileDialogEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string FileName
{
get { return fileName; }
set { fileName = value; }
}
}
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
public class OpenFileDialogEditor : System.Drawing.Design.UITypeEditor
{
public OpenFileDialogEditor() { }
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
{
using (System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog())
{
if (value != null && !string.IsNullOrEmpty(value.ToString()))
{
try { ofd.FileName = value.ToString(); }
catch { }
}
if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
return ofd.FileName;
}
return string.Empty;
}
}
}
}
look the FileName property of TestClass
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
One of my articles might be able to help you with customizing the design-time events of user controls, it can be found here[^].
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|