Problem in Altering a dbf table , table corrupts
-
Dear all, I am using C# to alter a DBF file , Foxpro driver downloaded ,Everything working fine but after running alter query whole DBF format gets corrupted. And I am not able to open it again. I am adding the code snippet below.Do help me in this regard public void Alter_table() { try { string strConnect; strConnect="User ID=;DSN=;Collating Sequence=MACHINE;Data Source='d:\\22.dbf';Provider=VFPOLEDB.1;Cache Authentication=False;Mask Password=False;persist security info=False;Mode=Share Exclusive;Extended Properties=;Encrypt Password=False"; OleDbConnection dconn=new OleDbConnection(); dconn.ConnectionString = strConnect; dconn.Open(); OleDbCommand mycmd=new OleDbCommand(); OleDbCommand myCmd = new OleDbCommand("ALTER TABLE 22.dbf ADD COLUMN TEST1 c(10) NULL", dconn); myCmd.ExecuteNonQuery(); } catch(OleDbException ex) { MessageBox.Show(ex.Message); } } Thanks for any kind of help hi it is rudara
-
Dear all, I am using C# to alter a DBF file , Foxpro driver downloaded ,Everything working fine but after running alter query whole DBF format gets corrupted. And I am not able to open it again. I am adding the code snippet below.Do help me in this regard public void Alter_table() { try { string strConnect; strConnect="User ID=;DSN=;Collating Sequence=MACHINE;Data Source='d:\\22.dbf';Provider=VFPOLEDB.1;Cache Authentication=False;Mask Password=False;persist security info=False;Mode=Share Exclusive;Extended Properties=;Encrypt Password=False"; OleDbConnection dconn=new OleDbConnection(); dconn.ConnectionString = strConnect; dconn.Open(); OleDbCommand mycmd=new OleDbCommand(); OleDbCommand myCmd = new OleDbCommand("ALTER TABLE 22.dbf ADD COLUMN TEST1 c(10) NULL", dconn); myCmd.ExecuteNonQuery(); } catch(OleDbException ex) { MessageBox.Show(ex.Message); } } Thanks for any kind of help hi it is rudara