Click here to Skip to main content
16,004,782 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How can I know the location of error by Stack Trace given? Pin
miss nadia8-May-08 3:16
miss nadia8-May-08 3:16 
AnswerRe: How can I know the location of error by Stack Trace given? Pin
Christian Graus6-May-08 19:54
protectorChristian Graus6-May-08 19:54 
GeneralRe: How can I know the location of error by Stack Trace given? Pin
miss nadia8-May-08 4:10
miss nadia8-May-08 4:10 
GeneralRe: How can I know the location of error by Stack Trace given? Pin
miss nadia8-May-08 4:13
miss nadia8-May-08 4:13 
AnswerRe: How can I know the location of error by Stack Trace given? Pin
Herman<T>.Instance7-May-08 3:39
Herman<T>.Instance7-May-08 3:39 
Questiongenerate excel with validation list Pin
Mhiny6-May-08 18:53
Mhiny6-May-08 18:53 
AnswerRe: generate excel with validation list Pin
Vasudevan Deepak Kumar6-May-08 19:28
Vasudevan Deepak Kumar6-May-08 19:28 
GeneralRe: generate excel with validation list Pin
Mhiny6-May-08 20:42
Mhiny6-May-08 20:42 
Hi
Thanks for replying.
I want the Excel to have a drop-down list.
I have a string of xml like this:

xml.txt
<br />
<?xml version="1.0"?><br />
<?mso-application progid="Excel.Sheet"?><br />
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"<br />
 xmlns: o ="urn:schemas-microsoft-com:office:office"<br />
 xmlns: x ="urn:schemas-microsoft-com:office:excel"<br />
 xmlns:ss ="urn:schemas-microsoft-com:office:spreadsheet"<br />
 xmlns:html ="http://www.w3.org/TR/REC-html40"><br />
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><br />
  <Author>Mee</Author><br />
  <LastAuthor>Mee</LastAuthor><br />
  <Created>2008-05-07T06:18:28Z</Created><br />
  <Company>Ram</Company><br />
  <Version>11.5606</Version><br />
 </DocumentProperties><br />
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><br />
  <WindowHeight>8700</WindowHeight><br />
  <WindowWidth>12315</WindowWidth><br />
  <WindowTopX>0</WindowTopX><br />
  <WindowTopY>120</WindowTopY><br />
  <ProtectStructure>False</ProtectStructure><br />
  <ProtectWindows>False</ProtectWindows><br />
 </ExcelWorkbook><br />
 <Styles><br />
  <Style ss:ID="Default" ss:Name="Normal"><br />
   <Alignment ss:Vertical="Bottom"/><br />
   <Borders/><br />
   <Font x:CharSet="222"/><br />
   <Interior/><br />
   <NumberFormat/><br />
   <Protection/><br />
  </Style><br />
 </Styles><br />
 <Names><br />
  <NamedRange ss:Name="x" ss:RefersTo="=Sheet2!R1C1:R2C1"/><br />
 </Names><br />
 <Worksheet ss:Name="Sheet1"><br />
  <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"<br />
   x:FullRows="1"><br />
   <Row><br />
    <Cell><Data ss:Type="String">data</Data></Cell><br />
   </Row><br />
  </Table><br />
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><br />
   <Selected/><br />
   <Panes><br />
    <Pane><br />
     <Number>3</Number><br />
     <ActiveRow>2</ActiveRow><br />
    </Pane><br />
   </Panes><br />
   <ProtectObjects>False</ProtectObjects><br />
   <ProtectScenarios>False</ProtectScenarios><br />
  </WorksheetOptions><br />
  <DataValidation xmlns="urn:schemas-microsoft-com:office:excel"><br />
   <Range>R2C1</Range><br />
   <Type>List</Type><br />
   <Value>x</Value><br />
  </DataValidation><br />
 </Worksheet><br />
 <Worksheet ss:Name="Sheet2"><br />
  <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="2" x:FullColumns="1"<br />
   x:FullRows="1"><br />
   <Row><br />
    <Cell><Data ss:Type="Number">1</Data><NamedCell ss:Name="x"/></Cell><br />
   </Row><br />
   <Row><br />
    <Cell><Data ss:Type="Number">2</Data><NamedCell ss:Name="x"/></Cell><br />
   </Row><br />
  </Table><br />
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><br />
   <Panes><br />
    <Pane><br />
     <Number>3</Number><br />
     <RangeSelection>R1C1:R2C1</RangeSelection><br />
    </Pane><br />
   </Panes><br />
   <ProtectObjects>False</ProtectObjects><br />
   <ProtectScenarios>False</ProtectScenarios><br />
  </WorksheetOptions><br />
 </Worksheet><br />
</Workbook>


I want to convert this string to excel(*.xls) .
I try this :

 <br />
            f = New FileInfo("c:\test.xls")<br />
            f.Delete()<br />
            s = f.CreateText<br />
<br />
            s.WriteLine('string from xml.txt')<br />
            s.Close()<br />
<br />
<br />
     <br />
   <br />

This code can generate the excel file but when i import excel's data
by this code:
 <br />
        Dim ds As New DataSet<br />
        Dim Olecn As OleDb.OleDbConnection<br />
        Dim da As OleDb.OleDbDataAdapter<br />
        Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
           "Data Source=" & FilePath & ";" & _<br />
           "Extended Properties=""Excel 8.0;HDR=Yes"""<br />
        Olecn = New OleDb.OleDbConnection(strConn)<br />
        Olecn.Open()<br />
        da = New OleDb.OleDbDataAdapter("SELECT * FROM [" + SheetName + "$]" ), strConn)<br />
        Try<br />
            da.Fill(ds)<br />
        Catch<br />
<br />
        Finally<br />
            Olecn.Close()<br />
        End Try<br />
        Return ds<br />


This not works.
I can't import data that create from this excel.
I don't know why .
Thanks in advance
QuestionIE throwing a error but Firfox works fine, WHY? Pin
Meax6-May-08 18:28
Meax6-May-08 18:28 
AnswerRe: IE throwing a error but Firfox works fine, WHY? Pin
N a v a n e e t h6-May-08 19:15
N a v a n e e t h6-May-08 19:15 
QuestionCalling a server side event handler in response to DropDownList Focus Change Pin
sagittarian6-May-08 16:53
sagittarian6-May-08 16:53 
AnswerRe: Calling a server side event handler in response to DropDownList Focus Change Pin
Christian Graus6-May-08 18:14
protectorChristian Graus6-May-08 18:14 
QuestionConfirm Dialog for ASP.Net Pin
sagittarian6-May-08 16:40
sagittarian6-May-08 16:40 
AnswerRe: Confirm Dialog for ASP.Net Pin
AlexeiXX36-May-08 17:24
AlexeiXX36-May-08 17:24 
QuestionRepeater Control: if the value of a record was true show something but false dont Pin
Farhad Eft6-May-08 10:59
Farhad Eft6-May-08 10:59 
AnswerRe: Repeater Control: if the value of a record was true show something but false dont Pin
Christian Graus6-May-08 11:54
protectorChristian Graus6-May-08 11:54 
AnswerRe: Repeater Control: if the value of a record was true show something but false dont Pin
AlexeiXX36-May-08 14:16
AlexeiXX36-May-08 14:16 
GeneralRe: Repeater Control: if the value of a record was true show something but false dont Pin
Christian Graus6-May-08 15:40
protectorChristian Graus6-May-08 15:40 
GeneralRe: Repeater Control: if the value of a record was true show something but false dont Pin
AlexeiXX36-May-08 17:19
AlexeiXX36-May-08 17:19 
GeneralRe: Repeater Control: if the value of a record was true show something but false dont Pin
Christian Graus6-May-08 17:52
protectorChristian Graus6-May-08 17:52 
Questionhow to display data in a gridview? Pin
wajans6-May-08 10:33
wajans6-May-08 10:33 
AnswerRe: how to display data in a gridview? Pin
doWhileSomething6-May-08 10:48
doWhileSomething6-May-08 10:48 
GeneralRe: how to display data in a gridview? Pin
wajans6-May-08 10:54
wajans6-May-08 10:54 
AnswerRe: how to display data in a gridview? Pin
Christian Graus6-May-08 13:31
protectorChristian Graus6-May-08 13:31 
GeneralRe: how to display data in a gridview? Pin
wajans6-May-08 14:32
wajans6-May-08 14:32 

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.