Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void connect()
- {
- try
- {
- if (checkbox1.Checked == false)
- {
- FilePath = @"C:FILE";
- }
- else
- {
- FilePath = @"\192.168.0.2file"; //
- }
- strConn = @"Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + FilePath + @";Extensions=csv,txt";
- Connect = new OdbcConnection(strConn);
- Connect.Open();
- }
- catch (Exception Ex)
- {
- MessageBox.Show(Ex.Message);
- }
- DataGrid1.SelectAll();
- DataGrid1.ClearSelection();
- FileName = ".csv";
- CSVDataSource = FilePath + FileName;
- ReadData(FileName);
- DataGrid1.Update();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement