A
androoo
I have a source database which stores the main image.
I read the image out as this :
Dim strSQL As String
Dim objData As clsDatabase
Dim dr As OleDb.OleDbDataReader
strSQL += "select * from picstable" ' this is a foxpro database
'open object for database work
objData = objData.GetInstance
dr = objData.GetDatareader(strSQL)
While dr.Read
objWriter.Write(dr.Item("picdata"))
end while
So now i have the data i need to copy it into another (Ms-Access)
database..
I tried this..
While dr.Read
strConnStr = ConfigurationSettings.AppSettings("connString")
Dim objConn As New OleDbConnection(strConnStr)
objConn.Open()
Dim cmd As New OleDbCommand("INSERT INTO prodpics(pic) VALUES (?)",
objConn)
Dim bytearray() As Byte
cmd.Parameters.Add(dr.Item("picdata"), OleDbType.Binary).Value =
bytearray
objConn.Open()
cmd.ExecuteNonQuery()
objConn.Close()
end while
I get a huge error message, im new to paramterised queries such as this
so any help appreciated
error is :
System.Reflection.AmbiguousMatchException: No accessible overloaded
'OleDbParameterCollection.Add' can be called without a narrowing
conversion. at
Microsoft.VisualBasic.CompilerServices.VBBinder.set_InternalThrow(Exception
Value) at
Microsoft.VisualBasic.CompilerServices.VBBinder.BindToMethod(BindingFlags
bindingAttr, MethodBase[] match, Object[]& args, ParameterModifier[]
modifiers, CultureInfo culture, String[] names, Object& ObjState) at
Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String
name, BindingFlags invokeAttr, Type objType, IReflect objIReflect,
Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters) at
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack) at eXcommerce.WebForm1.Button2_Click(Object sender,
EventArgs e) in www...
I read the image out as this :
Dim strSQL As String
Dim objData As clsDatabase
Dim dr As OleDb.OleDbDataReader
strSQL += "select * from picstable" ' this is a foxpro database
'open object for database work
objData = objData.GetInstance
dr = objData.GetDatareader(strSQL)
While dr.Read
objWriter.Write(dr.Item("picdata"))
end while
So now i have the data i need to copy it into another (Ms-Access)
database..
I tried this..
While dr.Read
strConnStr = ConfigurationSettings.AppSettings("connString")
Dim objConn As New OleDbConnection(strConnStr)
objConn.Open()
Dim cmd As New OleDbCommand("INSERT INTO prodpics(pic) VALUES (?)",
objConn)
Dim bytearray() As Byte
cmd.Parameters.Add(dr.Item("picdata"), OleDbType.Binary).Value =
bytearray
objConn.Open()
cmd.ExecuteNonQuery()
objConn.Close()
end while
I get a huge error message, im new to paramterised queries such as this
so any help appreciated
error is :
System.Reflection.AmbiguousMatchException: No accessible overloaded
'OleDbParameterCollection.Add' can be called without a narrowing
conversion. at
Microsoft.VisualBasic.CompilerServices.VBBinder.set_InternalThrow(Exception
Value) at
Microsoft.VisualBasic.CompilerServices.VBBinder.BindToMethod(BindingFlags
bindingAttr, MethodBase[] match, Object[]& args, ParameterModifier[]
modifiers, CultureInfo culture, String[] names, Object& ObjState) at
Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String
name, BindingFlags invokeAttr, Type objType, IReflect objIReflect,
Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters) at
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack) at eXcommerce.WebForm1.Button2_Click(Object sender,
EventArgs e) in www...