Click here to Skip to main content
       

Web Development

 
AnswerRe: Not able to Ajax post knockout (KO) data in XML format PinmemberPacker L24-May-12 0:52 
Questiontigrina lexikon ትግርኛ መዝገብ ቃላት seglelet.com Pinmembermululer19-May-12 23:27 
QuestionHow to display XML data using XSL in HTML? Pinmemberdrajkulki18-May-12 2:35 
AnswerRe: How to display XML data using XSL in HTML? Pinmemberberba19-May-12 7:44 
QuestionProblem with Knockout mapping of observable array. PinmemberPacker L18-May-12 1:04 
AnswerRe: Problem with Knockout mapping of observable array. [modified] PinmemberPacker L18-May-12 21:07 
Questionhow can i bind data from excel file? Pinmemberheinhtataung17-May-12 0:09 
AnswerRe: how can i bind data from excel file? PinmemberMickt198519-May-12 22:36 
Hey they are 2 ways which you can achieve this. You can get the cell range and store it in an array and then read the values from the array like so :
this.openFileDialog1.FileName = "*.xls";
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
Excel.Workbook theWorkbook = ExcelObj.Workbooks.Open(
openFileDialog1.FileName, 0, true, 5,
"", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,
0, true);
Excel.Sheets sheets = theWorkbook.Worksheets;
Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
for (int i = 1; i <= 10; i++)
{
Excel.Range range = worksheet.get_Range("A"+i.ToString(), "J" + i.ToString());
System.Array myvalues = (System.Array)range.Cells.Value;
string[] strArray = ConvertToStringArray(myvalues);
TextBox.Text = strArray[0].ToString();
}
}
or you could use OleDb like so assuming you have a sheet in the excel file called MyObject :
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Book1.xls;Extended Properties=Excel 8.0");
OleDbDataAdapter da = new OleDbDataAdapter("select * from MyObject", con);
DataTable dt = new DataTable();
da.Fill(dt);
 
Hope this helps
 

AnswerRe: how can i bind data from excel file? PinmemberMickt198525-May-12 12:08 
QuestionUse of Session states in SharePoint 2010 PinmemberAthar Raza Faridi16-May-12 21:37 
QuestionMessage box with 3 buttons Yes/NO/Cancel in ASP.Net Pinmemberberba16-May-12 4:15 
AnswerRe: Message box with 3 buttons Yes/NO/Cancel in ASP.Net PinmvpSandeep Mewara16-May-12 8:38 
QuestionEmails Sent by Window Service/C# Code are landing in spam in Gmail Pinmembermasterprogrammertech14-May-12 2:19 
AnswerRe: Emails Sent by Window Service/C# Code are landing in spam in Gmail PinmemberBernhard Hiller14-May-12 22:36 
QuestionSubpages are not found. Pinmemberm_kukulka10-May-12 4:03 
AnswerRe: Subpages are not found. PinmemberBernhard Hiller10-May-12 5:25 
QuestionWeb Crawling / Searching Pinmembereddieangel9-May-12 7:08 
AnswerRe: Web Crawling / Searching PinmemberBernhard Hiller9-May-12 22:20 
QuestionFormat Date According to Regional Settings Pinmemberberba9-May-12 4:22 
AnswerRe: Format Date According to Regional Settings PinmvpRichard MacCutchan9-May-12 5:31 
AnswerRe: Format Date According to Regional Settings PinmemberDavid Mujica9-May-12 5:35 
GeneralHow to write code for Admin approve ! Pinmemberheinhtataung8-May-12 19:26 
GeneralRe: How to write code for Admin approve ! PinmemberDavid Mujica9-May-12 5:30 
GeneralRe: How to write code for Admin approve ! Pinmemberheinhtataung10-May-12 22:00 
QuestionGenetic algorithm for class schedule with PHP PinmemberLuki Dwiyanto7-May-12 20:14 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 21 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid