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.OleDbData Reader
strSQL += "select * from picstable" ' this is a foxpro database
'open object for database work
objData = objData.GetInst ance
dr = objData.GetData reader(strSQL)
While dr.Read
objWriter.Write (dr.Item("picda ta"))
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 = ConfigurationSe ttings.AppSetti ngs("connString ")
Dim objConn As New OleDbConnection (strConnStr)
objConn.Open()
Dim cmd As New OleDbCommand("I NSERT INTO prodpics(pic) VALUES (?)",
objConn)
Dim bytearray() As Byte
cmd.Parameters. Add(dr.Item("pi cdata"), OleDbType.Binar y).Value =
bytearray
objConn.Open()
cmd.ExecuteNonQ uery()
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.Reflecti on.AmbiguousMat chException: No accessible overloaded
'OleDbParameter Collection.Add' can be called without a narrowing
conversion. at
Microsoft.Visua lBasic.Compiler Services.VBBind er.set_Internal Throw(Exception
Value) at
Microsoft.Visua lBasic.Compiler Services.VBBind er.BindToMethod (BindingFlags
bindingAttr, MethodBase[] match, Object[]& args, ParameterModifi er[]
modifiers, CultureInfo culture, String[] names, Object& ObjState) at
Microsoft.Visua lBasic.Compiler Services.VBBind er.InvokeMember (String
name, BindingFlags invokeAttr, Type objType, IReflect objIReflect,
Object target, Object[] args, ParameterModifi er[] modifiers,
CultureInfo culture, String[] namedParameters ) at
Microsoft.Visua lBasic.Compiler Services.LateBi nding.LateGet(O bject o,
Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack) at eXcommerce.WebF orm1.Button2_Cl ick(Object sender,
EventArgs e) in www...