AcceptChanges Specified Cast ....

T

thomson

Hi all,

Iam getting a Specified cast not valid on this line
((System.Data.OleDb.OleDbDataAdapter)objDataAdapter).AcceptChangesDuringFill=false;

Please help me out


thanks in advance


thomson
 
K

Karl Seguin

objDataAdapter isn't of type System.Data.OleDb.OleDbDataAdapter.....but
other than that we can't tell you anything more.

Add a breakpoint to the line and a add a watch to "objdataAdapter" it'll
tell you what type it is...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
T

thomson

IDataAdapter objDataAdapter;
objDataAdapter = new
System.Data.SqlClient.SqlDataAdapter((System.Data.SqlClient.SqlCommand)objCommand);
((System.Data.OleDb.OleDbDataAdapter)objDataAdapter).AcceptChangesDuringFill=false;

Karl this wont work in SQL Data Adapter,
 
T

thomson

Sorry Karl I made a big mistake, Now it working for me, that was the
error,

Thanks for helping me out


Regards

thomson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top