When I use jet to import a tab delimited text file the data grid is missing some of the data. It appears colums of serial numbers imported ok if they were all numeric, but dropped serial numbers beginning with a letter. Code follows with one line of sample output:
<%@ Page Language="C#" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<script runat="server">
void Page_Load(object sender, EventArgs e) {
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=E:\program Files\DevStudio\
vb\Asp_net_1_1_book\Database; Extended Properties=""text;HDR=YES;"";";
string CommandText = "select * from TESTTEXT.txt";
OleDbConnection myConnection = new OleDbConnection(ConnectionString);
OleDbCommand myCommand = new OleDbCommand(CommandText, myConnection);
myConnection.Open();
DataGrid1.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConne ction);
DataGrid1.DataBind();
myConnection.Close();
}
</script>
<html>
<head>
</head>
<body style="FONT-FAMILY: arial">
<h2>Simple Data Report
</h2>
<form runat="server">
<asp:datagrid id="DataGrid1" runat="server" EnableViewState="False" ForeColor="Black" BackColor="White" CellPadding="3" GridLines="None" CellSpacing="1">
<HeaderStyle font-bold="True" forecolor="white" backcolor="#4A3C8C"></HeaderStyle>
<ItemStyle backcolor="#DEDFDE"></ItemStyle>
</asp:datagrid>
</form>
</body>
</html>
Sample output. Registry has jet text delimiter value set to tabdelimited (that part is working). Serial number on 3rd line
should have said B012345. If I but a letter in front of the value
4655117 serial number in the file, then both serial numbers show up.
The column in the data grid is autoformatting to numeric and dropping
text items. Why?
EQID MFGR MODL SRNO
19534-1 FLUKE 8050A 4655117
58206-1 TEK 2235