locked
How to import .dat file to sql in ASP.net RRS feed

  • Question

  • User-1094981702 posted

    Hi all,

    I just want to ask how to import a .dat file to sql table in ASP.net.  The .dat file is the report comes from our Biometrics Device (fingerscan)

    Please give me a sample form with uploading.  Thanks.

     

    Tuesday, May 4, 2010 3:00 AM

Answers

  • User347897345 posted

    Hello,


    The following links may be helpful to u:


    http://msdn.microsoft.com/en-us/library/ms178129.aspx

    http://www.dbforums.com/microsoft-sql-server/1199233-import-dat-file-sql-2000-a.html



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 5, 2010 12:59 AM

All replies

  • User2108726364 posted
    BULK INSERT pubs..publishers2 FROM 'c:\newpubs.dat'
    WITH (
    DATAFILETYPE = 'char',
    FIELDTERMINATOR = ',',
    ROWTERMINATOR = '\n'
    )

    http://msdn.microsoft.com/en-us/library/aa173839%28SQL.80%29.aspx




    Tuesday, May 4, 2010 5:39 AM
  • User2090264947 posted

    check out the link

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=124398

    Tuesday, May 4, 2010 8:39 AM
  • User-1094981702 posted

    Thanks for your swift reponse.

    Do I need to create a new table to insert the data of my *.dat file.

     Here are the sample date when I edit the *.dat file in notepad

     9589     2010-03-29 16:01:01       1      1      1      0
     7756     2010-03-29 16:08:06       1      1      1      0
     9648     2010-03-29 16:18:04       1      2      1      0
     9647     2010-03-29 16:18:15       1      1      1      0
     9649     2010-03-29 16:18:22       1      2      1      0
     9208     2010-03-29 16:18:36       1      1      1      0
     9208     2010-03-29 16:18:41       1      1      1      0

    There are six colums that corresponds to the following (employeeID, DateTime, MachineID,  CheckInOutID, SensorID, ValidationID)

    How can I transfer it to a table using a vb.net code on my upload form.

    Can you give me a sample coding on how to access it using my upload button.  Thank you very much.

     


     

    Tuesday, May 4, 2010 11:32 PM
  • User347897345 posted

    Hello,


    The following links may be helpful to u:


    http://msdn.microsoft.com/en-us/library/ms178129.aspx

    http://www.dbforums.com/microsoft-sql-server/1199233-import-dat-file-sql-2000-a.html



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 5, 2010 12:59 AM
  • User-1094981702 posted

    Can you help me on making an xml file.

    I just want to get the EmployeeID, Date and CheckInOutId and skip the others.

    My XML file I made have errors.

     

    Wednesday, May 5, 2010 3:19 AM
  • User347897345 posted

    U can check out the following.. It should be very helpful to u in order to understand  how to create an xml file and getting the node values from it..


    http://vb.net-informations.com/xml/create-xml-vb.net.htm

    Monday, May 10, 2010 12:35 AM