|
The ADO.NET replacement you are looking for is based around the SqlCommand , SqlConnection classes."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I am very familiar with SqlConnection and SqlCommand ; I have been using them extensively for some time. My question was about getting a large binary file from the file system into a VARBINARY(max) database column. I can do this pretty easily using ADODB.Stream , as shown in my code in the OP. I'd like to learn the .Net equivalent and avoid using COM interop.
|
|
|
|
|
You should set the parameter to SqlDbType.VarBinary . Set SqlParameter.Value to the byte[] that corresponds to the byte array you have read in from the file (it is just a stream after all)."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Your solution is actually one of the first things I tried, but I kept getting an exception when the code was executed. Turns out, the problem -- revealed by an inner exception and not by the outer one I was reading -- was bad syntax.
Yeah, it's working now, and without running into a 8000 byte limit that some documentation seemed to state: the PDF file is 97k. I assume that the only practical limit to this method is available memory? And I assume there is no problem with streamlining the parameter declaration to AttParam.Value = System.IO.File.ReadAllBytes(DocPath) ?
Thanks for your assistance. Now, if you'll excuse me, I have a wall to bang with my head.
|
|
|
|
|
TechBearSeattle wrote: I assume that the only practical limit to this method is available memory? And I assume there is no problem with streamlining the parameter declaration to AttParam.Value = System.IO.File.ReadAllBytes(DocPath)?
Shouldn't be any problems there, and I'm glad I could help."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Dear friends on the block, my name is danso and i'm getting hands on .NET FRAMEWORK for the fist time.
I will be glad to get supports from anyone here. Thanks
|
|
|
|
|
|
Thnaks....i now understand it's a programming language, with pre-biult codes that enhance on developing a system or application.
|
|
|
|
|
danso sackey wrote: ....i now understand it's a programming language
Uhhh, read it again. No, it's not a programming lanugage.
The .NET Framework is a huge collections of classes that can be used acrossed a wide range of languages, all targeting the .NET CLR, making writing applications easier, among other things.
The .NET CLR is a managed execution environment that runs these applications.
|
|
|
|
|
No it's not. It's a framework that provides common facilities for any language that subscribes to it to develop against. These languages must support the common runtime and common language specs to be classed as .NET compatible."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
I have a desktop application in .Net 2.0
I have a com class added in bin folder Interop.prjBatPrt.dll
now running the application I'm getting the following error...
ComException Was Unhandled...
Retrieving the COM class factory for component with CLSID {00A4F4E0-380D-4DDD-9752-50FDA24BAC15} failed due to the following error: 80040154.
can anyone help me to figure it out....
|
|
|
|
|
This is a general error. What you can do is ,
1. Check that the class installed is actuallt installed properly.( if not then re-installe that correctly)
2. Reset the identity user id/passwork that you might have there in com explorer.
2. Lastly, make sure that COM component is working correct at runtime. That can be tested this way: You can write a vb script file(.vbs) and try to invoke that COM component by just creating an instance of the class. If that is created then using the vbscript itself call the method to see whether that method which you might have used is actually invoked correctly.
Sample VBscript code.Save this as "test.vbs" and double click and run.
obj = CreateObject("yourcalssname")
msgbox(IsObject(obj)) Thanks,
Arindam D Tewary
|
|
|
|
|
thanx arindam ...problem solved
|
|
|
|
|
vkumar09 wrote: I have a com class added in bin folder Interop.prjBatPrt.dll
No, that's not a COM class. That is a wrapper used as an interface between your managed code and the COM component you're code is using. A common newbie mistake is to deploy just that .DLL with the application and wonder why the app suddenly doesn't work. You also need the COM component you're using installed on the target machine as well as the wrapper .DLL's.
|
|
|
|
|
How to print 1000 line in one page.
i use POS printer.
C.Kumarasinghe
|
|
|
|
|
Make the text really small I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Just set your page size to 1000 / lines per inch - calculated from font height. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
C.Kumarasinghe wrote: i use POS printer.
Go buy a good one then."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I don't know how many times you're going to ask the same question, but I'm only going to answer it once.
See if this article[^] can help.
|
|
|
|
|
if i install sql express edition and visual studio 2005 in my system which shd i first install? and my another question is, Is there any free version of visual studio 2005 available to download?.
thanks and regards
Suni
|
|
|
|
|
sunyjose wrote: if i install sql express edition and visual studio 2005 in my system which shd i first install?
It doesn't really matter.
sunyjose wrote: and my another question is, Is there any free version of visual studio 2005 available to download?.
Yes, Visual Studio 2005 Express Edition. A little Google goes a long way. You may want to scrap the 2005 version and go for 2008 instead.
|
|
|
|
|
If you install Visual C++ 2008 Express Edition[^] you can get the SQL Edition automatically included. [edit]Not sure this last is still true, website has changed[/edit]. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Well... I load from database some tables in comboboxes. I want to display only a part of data (i work with adress (state, region, street, cp etc.)) so i use local datasets and load all of it in combobox with arraylist (datasource, displaymember etc.). But i can't just register every street in the country, so for a special place i register all of it, and for all other i want to make possible to register it if it's not registered. So i need to check if i write in combobox some text and then want to insert it in the database if this text is already in the combobox displaymember. So how can i search for an item in combobox by displaymember text?
|
|
|
|
|
Your question is rather confusing, I don't understand what you mean by "register" in the above context. Perhaps you could try to clarify what it is that you are trying to do. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|