Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: combo box Pin
costavo13-Aug-07 0:02
costavo13-Aug-07 0:02 
GeneralRe: combo box Pin
Michael Sync13-Aug-07 16:49
Michael Sync13-Aug-07 16:49 
QuestionWPF Top level exception handling problem Pin
Keith Barrow12-Aug-07 23:09
professionalKeith Barrow12-Aug-07 23:09 
QuestionC# directX how to getit up? Pin
mercenary0112-Aug-07 22:58
mercenary0112-Aug-07 22:58 
AnswerRe: C# directX how to getit up? Pin
stancrm12-Aug-07 23:09
stancrm12-Aug-07 23:09 
AnswerRe: C# directX how to getit up? Pin
Talal Sultan12-Aug-07 23:11
Talal Sultan12-Aug-07 23:11 
QuestionUPnP AV Client in C# Pin
N-O-R-B-E-R-T12-Aug-07 22:37
N-O-R-B-E-R-T12-Aug-07 22:37 
AnswerRe: UPnP AV Client in C# Pin
leppie12-Aug-07 23:39
leppie12-Aug-07 23:39 
AnswerRe: UPnP AV Client in C# Pin
leppie12-Aug-07 23:40
leppie12-Aug-07 23:40 
Questionhow to setup C# TCPClient timeout Pin
George_George12-Aug-07 22:36
George_George12-Aug-07 22:36 
QuestionConnection to SQL ! Pin
mrkeivan12-Aug-07 21:59
mrkeivan12-Aug-07 21:59 
AnswerRe: Connection to SQL ! Pin
Giorgi Dalakishvili12-Aug-07 22:09
mentorGiorgi Dalakishvili12-Aug-07 22:09 
Questionvertical align in richtextbox Pin
Cuciu12-Aug-07 21:38
Cuciu12-Aug-07 21:38 
Questionc# - Painting problem Pin
T.D.Prasad12-Aug-07 21:27
T.D.Prasad12-Aug-07 21:27 
AnswerRe: c# - Painting problem Pin
Albu Marius12-Aug-07 22:31
Albu Marius12-Aug-07 22:31 
AnswerRe: c# - Painting problem Pin
Cuciu12-Aug-07 22:42
Cuciu12-Aug-07 22:42 
QuestionRe: c# - Painting problem Pin
T.D.Prasad12-Aug-07 23:51
T.D.Prasad12-Aug-07 23:51 
AnswerRe: c# - Painting problem Pin
Christian Graus13-Aug-07 0:31
protectorChristian Graus13-Aug-07 0:31 
AnswerRe: c# - Painting problem Pin
Christian Graus12-Aug-07 23:52
protectorChristian Graus12-Aug-07 23:52 
QuestionReading Numeric and AlphaNumeric Values from Excel Pin
meeram39512-Aug-07 20:10
meeram39512-Aug-07 20:10 
Hi

I have an Excel sheet, has 4 columns. In the first column there is an industry code, which contains both numeric and alphanumeric chararcters. I'm not able to read the values to the dataset if the value is alphabets. For eg. if the value is 1,2,3,4 etc.. it will read. But if the value is 1a, 2b, 3e, 4d etc. then it will read as null. Anybody has any solution for these? Any help would be great. I'll post my code below:

OleDbCommand MyCommand;
OleDbConnection MyConnection;

MyConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=C:\\Projects\\LiquidCreditChains\\CreditCurveMapping.xls;Extended Properties=Excel 8.0;");

if (MyConnection.State != ConnectionState.Closed)
MyConnection.Close();
else
MyConnection.Open();

DataTable dtSector = new DataTable("SectorChains");
objds.Tables.Add(dtSector);

DataColumn dc1 = new DataColumn("Indust_Code");
dc1.DataType = System.Type.GetType("System.String");
dtSector.Columns.Add(dc1);
DataColumn dc2 = new DataColumn("Indust_Number");
dc2.DataType = System.Type.GetType("System.Int64");
dtSector.Columns.Add(dc2);
DataColumn dc3 = new DataColumn("MappingDescription");
dc3.DataType = System.Type.GetType("System.String");
dtSector.Columns.Add(dc3);
DataColumn dc4 = new DataColumn("SubDescription");
dc4.DataType = System.Type.GetType("System.String");
dtSector.Columns.Add(dc4);
DataColumn dc5 = new DataColumn("Mapping_Curve");
dc5.DataType = System.Type.GetType("System.String");
dtSector.Columns.Add(dc5);

MyCommand = new OleDbCommand("select * from [Sheet1$]", MyConnection);
OleDbDataReader dr1 = MyCommand.ExecuteReader();

while (dr1.Read())
{

DataRow newChainRow = objds.Tables[0].NewRow();

newChainRow["Indust_Code"] = dr1[0].ToString();
newChainRow["Indust_Number"]=dr1[1].ToString();
newChainRow["MappingDescription"] = dr1[2].ToString();
newChainRow["SubDescription"]= dr1[3].ToString();
newChainRow["Mapping_Curve"] = dr1[4].ToString();
objds.Tables[0].Rows.Add(newChainRow);
}

Any help in this regard would be great!!

Thanks

Meeram395

AnswerRe: Reading Numeric and AlphaNumeric Values from Excel Pin
travlos718-Mar-09 6:14
travlos718-Mar-09 6:14 
AnswerRe: Reading Numeric and AlphaNumeric Values from Excel Pin
InfoBridgeSolutions17-Aug-10 19:30
InfoBridgeSolutions17-Aug-10 19:30 
QuestionDatagrid paging-c# windows application Pin
hemchandars12-Aug-07 20:06
hemchandars12-Aug-07 20:06 
AnswerRe: Datagrid paging-c# windows application Pin
Jax_qqq12-Aug-07 21:41
Jax_qqq12-Aug-07 21:41 
GeneralRe: Datagrid paging-c# windows application Pin
hemchandars13-Aug-07 1:03
hemchandars13-Aug-07 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.