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
rudra083
Posts
-
Problem in Altering a dbf table , table corrupts -
Problem using MSFOxpro Provider,error could not open fileI am a GIS programmer in a company in India.I have seen your bog fixing in CODE comments. I have to Alter a DBF file , basically I have to add a column to my DBF table. but I am getting error like Couldn't open C:\final data\22.dbf file Same when I am using in other method with select query works fine ... I do hve the same problem which u faced but still I am not getting the right answer for this .Plz help me .The Code snippet which I am using is as follows. try { string ConnectionString="User ID=;DSN=;Collating Sequence=MACHINE;Data Source= ' C:\\final data\\22.dbf ' ;Provider=VFPOLEDB.1;Cache Authentication=False;Mask Password=False;persist security info=False;Mode=Share Deny None;Extended Properties=;Encrypt Password=False"; OleDbConnection dconn=new OleDbConnection(); dconn.ConnectionString = ConnectionString; dconn.Open(); OleDbCommand mycmd=new OleDbCommand(); OleDbCommand myCmd = new OleDbCommand("ALTER TABLE 'C:\\final data\\22.dbf' ADD UID int ", dconn); myCmd.ExecuteNonQuery(); } catch(OleDbException ex) { MessageBox.Show(ex.Message); } Plz help me in this regards,Its urgent Thanks a Lot Anil Dhiman GIS Engineer Nucleus Netsoft & GIS Ltd hi it is rudara
-
Database Provider error,Plz Help:zzz:Dear Frns, I am using dataset to load a .DBF file ,the provider downlaoded is foxpro provider. But sometimes it gives a provider error ,I dont know why it is like this Exception Raised is : " The Provider could not determine the decimal value.For Example, the row was just created,the default for the Decimal column was not available,and the consumer had not yet set a Decimal Value " I am able to load or fill dataset in some cases but sometimes it fails Plz help me in this regard hi it is rudra
-
datagrid out of bound error,Plz helpHello, Plz Help I have datagrid bound to a dataset My datagrid shows a column "UID" having some incremental values, I am having a value say 5, When I am writing dataGrid1.Select(5) it is giving me an error that index array out of bound I am filling the dataset using Fill method having only one table hi it is rudara
-
Datagrid Selection ,Giving out of bound index errorHello, Plz Help I have datagrid bound to a dataset My datagrid shows a column "UID" having some incremental values, I am having a value say 5, When I am writing dataGrid1.Select(5) it is giving me an error that index array out of bound I am filling the dataset using Fill method having only one table Thanks & Regards hi it is rudra