Click here to Skip to main content
15,916,601 members
Home / Discussions / C#
   

C#

 
QuestionDatabase search Pin
BH Serpa29-Jan-06 10:36
BH Serpa29-Jan-06 10:36 
QuestionWPF in VSTS ? Pin
Christian Graus29-Jan-06 9:53
protectorChristian Graus29-Jan-06 9:53 
AnswerRe: WPF in VSTS ? Pin
User 665829-Jan-06 10:14
User 665829-Jan-06 10:14 
AnswerRe: WPF in VSTS ? Pin
Joshua Quick29-Jan-06 10:18
Joshua Quick29-Jan-06 10:18 
GeneralRe: WPF in VSTS ? Pin
Christian Graus29-Jan-06 10:31
protectorChristian Graus29-Jan-06 10:31 
GeneralRe: WPF in VSTS ? Pin
Joshua Quick29-Jan-06 11:09
Joshua Quick29-Jan-06 11:09 
GeneralRe: WPF in VSTS ? Pin
Christian Graus29-Jan-06 11:45
protectorChristian Graus29-Jan-06 11:45 
Questionassigning objects a name programmatically Pin
usernamed29-Jan-06 9:37
usernamed29-Jan-06 9:37 
Hi,

I'm hoping someone can help me with a problem I'm having with an app that reads in an Excel spreadsheet. For each worksheet in the spreadsheet I want to create a DataTable that has the same name as the Excel worksheet. My code currently looks like this:

foreach (Microsoft.Office.Interop.Excel.Worksheet ws in wrkBook.Worksheets)<br />
                {<br />
                    <br />
                    if (ws.Name != null)<br />
                    {<br />
                        this.lstSheets.Items.Add(ws.Name);<br />
                        strWorksheet = ws.Name.ToString();<br />
                        System.Data.DataTable ws.Name = new System.Data.DataTable();<br />
                    }<br />
                }<br />


This doesn't work as it thinks I'm trying to reassign an existing object, rather than create a new object with the name of an existing object's property.

Can anyone explain how I can create as many datatables as exists in the spreadsheet file I open, and programmatically give each DataTable the same name as the worksheet from the spreadsheet?

Any assistance would be gratefully recieved!
AnswerRe: assigning objects a name programmatically Pin
Guffa29-Jan-06 9:55
Guffa29-Jan-06 9:55 
GeneralRe: assigning objects a name programmatically Pin
usernamed29-Jan-06 11:07
usernamed29-Jan-06 11:07 
AnswerRe: assigning objects a name programmatically Pin
Guffa29-Jan-06 12:12
Guffa29-Jan-06 12:12 
GeneralRe: assigning objects a name programmatically Pin
usernamed29-Jan-06 21:34
usernamed29-Jan-06 21:34 
GeneralRe: assigning objects a name programmatically Pin
User 665829-Jan-06 12:14
User 665829-Jan-06 12:14 
QuestionADO.NET updating Access Database with Dataset Pin
kourvoisier29-Jan-06 9:28
kourvoisier29-Jan-06 9:28 
QuestionHow to prevent windows form getting focus? Pin
3Dizard29-Jan-06 9:24
3Dizard29-Jan-06 9:24 
AnswerRe: How to prevent windows form getting focus? Pin
Ravi Bhavnani29-Jan-06 9:30
professionalRavi Bhavnani29-Jan-06 9:30 
QuestionHelp! Please! Pin
Holly2129-Jan-06 7:44
Holly2129-Jan-06 7:44 
AnswerRe: Help! Please! Pin
Dave Kreskowiak29-Jan-06 9:17
mveDave Kreskowiak29-Jan-06 9:17 
AnswerRe: Help! Please! Pin
Ravi Bhavnani29-Jan-06 9:21
professionalRavi Bhavnani29-Jan-06 9:21 
QuestionTabpage and tabcontrol : changing font size Pin
2hdass29-Jan-06 7:44
2hdass29-Jan-06 7:44 
AnswerRe: Tabpage and tabcontrol : changing font size Pin
tarasn29-Jan-06 20:53
tarasn29-Jan-06 20:53 
QuestionStart real training Pin
alex_kl29-Jan-06 7:23
alex_kl29-Jan-06 7:23 
AnswerRe: Start real training Pin
Christian Graus29-Jan-06 11:46
protectorChristian Graus29-Jan-06 11:46 
QuestionGraphics.CopyFromScreen() Pin
Dario Solera29-Jan-06 6:29
Dario Solera29-Jan-06 6:29 
AnswerRe: Graphics.CopyFromScreen() Pin
James Gupta29-Jan-06 6:38
professionalJames Gupta29-Jan-06 6:38 

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.