Home > Net >  CSV data in the asp.net web into error dataTable
CSV data in the asp.net web into error dataTable

Time:10-13

Export CSV data in SAP, want to import into the DataTable in asp.net, prompt "was not found on the selected data sources is called" Purchase Order ID field or property, "", and use the WPS, preserved can be again, what reason be?

.

Dim strConn As String=the String. Format (" Provider=Microsoft. Jet. The OLEDB. 4.0. Extended Properties='text; HDR=Yes; FMT=Delimited; CharacterSet=65001 '; Data Source='" & amp; Mp & amp; "'")
'connection Data, the Data Source for the CSV file exists directory
Dim conn As New OleDbConnection (strConn)
Dim dt1 As New DataTable ()
Dim SQL As String="select * from (" + filename +") "

Conn. The Open ()
Dim the Dr As New OleDbDataAdapter (SQL, conn)
Dim ds As New DataSet ()
Dr. Fill (ds, "table1")
Dt1=ds. Tables (" table1 ")
If dt1. Rows. Count & gt; 0 Then
Try
GridView1. The DataSource=dt1
GridView1. DataBind ()

Dim As Integer I
For I=0 To GridView1. Rows. The Count - 1
Dim txtPONum As String=(GridView1 Rows (I) Cells (1). The Text). The Trim
If txtPONum. Replace (" & amp; Have spent" , ""). The Trim=" "Then
GridView1. Rows (I) Cells (1). The Text=GridView1. Rows (I - 1) Cells (1). The Text
End the If
Next
Response. Write (" & lt; script> Alert (' reading success! '); </script>" )
Catch the ex As Exception
End Try
  • Related