View Complete Post
I want to import data from a xml file into a datasetthis is my xml file
<?xml version="1.0" encoding="UTF-8" standalone="no"?><Persons> <Person Personid="10"> <firstname>Hi</firstname> <lastname>bye</lastname> <Birthday>1360 </Birthday> <Phones> <Fax>04</Fax> <Other>05</Other> <Home>01</Home> </Phones> <Emails> <Email>Email@site.com</Email> </Emails> <Webs> <Web>web.com</Web> </Webs> </Person> </Persons>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
when I use this code dataset1.readxml(FilePath); I have these tables in my datasetPerson,Phones,Emails,WebsBut I want to have FIVE (more) tables for Fax,Mob
I am importing the data from excel file using following code.
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strFolderFileName) & ";Extended Properties=HTML Import;" conn = New OleDbConnection(connstr) Dim strSQL As String = "SELECT * FROM [" & strWorkSheetName & "]" Dim cmd As New OleDbCommand(strSQL, conn) Dim da As New OleDbDataAdapter(cmd) da.Fill(datatable)
Now the problem is if a coulmn vlaue start with a number value like "15" then the other string value like "W15" in that column is ignored in the datatable.
eg. The excel column value Column1
Is there a way to use a flat file which could be imported from the report in order to filtered the data displayed ?
I have to create one page where user will upload the excel file in SQl Server and system should check following things
1.Sheet Name should be always sheet1
2.System should check the column names
3.System should show the message that these many rows has been loaded
Hi, recently I encountered the following problem:
I tried to execute a stored procedure on the newly installed SQL 2005 Server (now on x64 Win Server 2003) which imports an Excel-File into a DB table.
We use OPENROWSET to access the Excel data. But I recognized this is dependent on Jet OLE DB which seems is not available for x64 windows.
Is there another way to import excel data using a stored procedure.
thank you in advance, rene
I'm looking for some tips / suggestions for the best way to handle file imports. Essentially, I have two scenarios where files are imported and would like to have one unified solution for importing. The first scenario is that we get files dropped into an FTP folder that are PGP encrypted. During processing, I want to decrypt these in memory so as never to have an unencrypted file sitting on the server. The second scenario will be when a user uploads a file via the .NET FileUpload control. These files will NOT be encrypted. Natively, I can grab FileUpload.FileBytes to get a byte array of the data. I'm using a 3rd party library (File Helpers) to parse the file and import into the database. The File Helpers library will accept any of the following: file path, string, or stream (TextReader). In this case, I think the stream is the way to go.
Ultimately, my question is what is the best way to go from a byte array to TextReader? I am doing the following:
MemoryStream ms = new MemoryStream(FileBytes);
StreamReader strmReader = new StreamReader(ms);
FileBytes is a byte array taken from the FileUpload control. With the PGP files, I can decrypt that right into a MemoryStream so then I'll just toss that to a StreamReader and will be good.
Thanks for the help!
First of all, I only know VB (I know that isn't great but it's all I got).
Second, I have a folder with 200+ pictures. I want to get the names of each of the pictures to the database.
Last, would it be easier to import and export the images into the database (I want my webpage to be able to show the images once they are in the database)?
I have been trying to import from an Excel file and insert it into a table.
I can upload the Excel file
I can view the Excel file in a grid
But when I run the import process to insert the rows in the Excel file I get only one row and it has all nulls except the dateentered and entered by field.
I added breakpoints and tried setting a couple of the fields to labels and I could see that data was getting to the reader.
So now I hoping someone might see something I'm missing here.
Protected Function ExcelConnection() As OleDbCommand
' Connect to the Excel Spreadsheet (online) = .ACE.OLEDB.12.0 (local) = .Jet.OLEDB.4.0
Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("~/Import_Process/ExcelImport_vol.xls") & ";" & _
"Extended Properties=Excel 8.0;" 'HDR=NO;IMEX=1"
' create your excel connection object using the connection string
Dim objXConn As New OleDbConnection(xConnStr)
' use a SQL Select command to retrieve the data from the Excel Spreadsheet
' the "table name" is the name of the worksheet within the spreadsheet
' in this case