TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anil Dhiman
NA
16
0
opening DBF thru OLEDB provider using C#.NET ,Giving error
Feb 9 2006 5:26 AM
Hello All,
I am facing a huge problem ,I am opening a DBF file .For some cases it is fine but few tables its giving errors like:-
"the Provider couldnot 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"
Code snippet is :-
public DataSet GetProjectTable()
{
string strSql,strConnect;
try
{
strConnect="User ID=;DSN=;Collating Sequence=MACHINE;Data Source= '" + ngisViewer_Open.lay + "'
rovider=VFPOLEDB.1;Cache Authentication=False;Mask Password=False;persist security info=False;Mode=Share Deny None;Extended Properties=;Encrypt Password=False";
OleDbConnection objConn = new OleDbConnection();
OleDbDataAdapter objDA= new OleDbDataAdapter();
OleDbDataAdapter objDA1= new OleDbDataAdapter();
OleDbCommand objCmd = new OleDbCommand();
objConn.ConnectionString = strConnect;
objConn.Open();
strSql = "select * from '" + ngisViewer_Open.lay_Name_Final + "' ";
objCmd.CommandText = strSql;
objCmd.Connection = objConn;
objDA.SelectCommand = objCmd;
DataColumn dc = new DataColumn("UID", typeof(int));
objDA.Fill(ds1,"MyTable");
ds1.Tables["MyTable"].Columns.Add(dc);
for(int j=0;j
{
ds1.Tables["MyTable"].Rows[j]["UID"]=j+1;
}
ds1.AcceptChanges();
objConn.Close();
}
catch( Exception ex)
{
String msg = ex.Message + ". Check the path." + " Already Open ";
MessageBox.Show(msg, "Validation",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
return (ds1);
}
Anil Dhiman
GIS Engineer
Reply
Answers (
1
)
Datagrid Problem
humble question with API