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
FEBY JOSEPH
NA
4
35.8k
[ODBC Microsoft Access Driver]Invalid precision value
Jan 19 2011 2:26 AM
ERROR [HY104] [Microsoft][ODBC Microsoft Access Driver]Invalid precision value
Hello All,
Please help me to resolve this error( Invalid precision value ) which I am getting from C # application when i am trying to insert IMAGES( BINARY FORMAT ) to the database( DB = MS Access ).
here is my code:
private
void
btnSaveToDB_Click(
object
sender, EventArgs e)
{
OdbcConnection odbcConnection =
null
;
OdbcCommand odbcCommand =
null
;
try
{
odbcConnection =
new
OdbcConnection(@
"Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\TestFP.mdb;Uid=;Pwd=;"
);
odbcConnection.Open();
odbcCommand = odbcConnection.CreateCommand();
odbcCommand.CommandText =
"INSERT INTO Employee ( Name ,FingerImage_1 ) VALUES (?,?)"
;
System.Data.Odbc.OdbcParameter nameFiled =
new
System.Data.Odbc.OdbcParameter();
nameFiled.OdbcType = System.Data.Odbc.OdbcType.Text;
nameFiled.ParameterName = @
"Name"
;
nameFiled.Value = @
"My Name"
;
odbcCommand.Parameters.Add(nameFiled);
System.Data.Odbc.OdbcParameter imageField_1 =
new
System.Data.Odbc.OdbcParameter();
imageField_1.OdbcType = System.Data.Odbc.OdbcType.Binary;
imageField_1.ParameterName = @
"FingerImage_1"
;
imageField_1.Value = _mainDialog._imageStream_1.ToArray();
odbcCommand.Parameters.Add(imageField_1);
int
rows_affected = odbcCommand.ExecuteNonQuery();
//RUN TIME ERROR = System.Data.Odbc.OdbcException: ERROR [HY104] [Microsoft][ODBC Microsoft Access Driver]Invalid precision value
}
catch
(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
odbcConnection.Close();
}
}
HERE is the Run Time Error
System.Data.Odbc.OdbcException: ERROR [HY104] [Microsoft][ODBC Microsoft Access Driver]Invalid precision value
I know that there is a property as follows
OdbcParameter.Precision
but how do i set "
OdbcParameter.Precision
" if my data ( which is inserted to database ) in binary format.....?
Please help me
Thanks in advance
Reply
Answers (
0
)
C# - Fetch Novell login info
[WINFORM] Image snapshot.Improve the image quality? (System.Drawing.Imaging.PixelFormat)