|
Perhaps, but this isn't the SQL forum.
If youre application doesn't need to do this as part of some more complex functions (i.e., you just need to do it internally from time to time), you should actually check out the bcp utility that ships with SQL Server, or use the BULK INSERT SQL statement (which I see no reason why it couldn't be used with ADO.NET to execute it) which does all this work for you.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You may want to look into Sql Server's Bulk copy functionality to do your inserts.
|
|
|
|
|
You may want to take a look at using SQL Server's Data Transformation Services(DTS) to perform the load. From your short description, it sounds like the kind of problem that DTS was made for.
Using an ActiveX task, you could make use of a COM-registered .NET assembly (or traditional COM object) to perform any advanced transformations needed on the binary source. Also, if this is a recurring task, DTS packages integrate nicely with SQL Server's job scheduler.
Hope that helps.
--Jesse
|
|
|
|
|
Dear Sir,
Thank you for your help, but i am searching for a solution which depend only on .net technology without using COM technology
regards
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
I have created a control based on the TextBox control, and would appreciate if someone could tell me how I can get the background to be painted with a brush using the HatchStyle and HatchStyle.OutlinedDiamond. The OnBackGround(...) and OnPaid (...) events don't seem to get fired off. I want to only have the background drawn with the HatchStyle.OutlinedDiamond as design time, and to have the normal background at runtime.
|
|
|
|
|
Easy, you cant! You will have to write one from scratch.
top secret
|
|
|
|
|
I want to close resource used by the web cam it gives error when i open the camara.......
|
|
|
|
|
Details! Lots more details!
Which webcam?
What are you using to communication with the webcam?
Are you using API calls and which ones?
Are you using WIA? The manufacturer's SDK?...
Code snippets of what your doing also help GREATLY!
RageInTheMachine9532
|
|
|
|
|
Hello,
If i have a simple Xml-file like this:
<test nummer="1">
<school name="handel">
<director> guy</director>
<teur> qui</teur>
</school>
<school name="bedrijf">
<director> louis</director>
<teur> qyu</teur>
</school>
</test>
How can i get the attributes "handel" en "bedrijf" in a textbox?
thx in advance
|
|
|
|
|
Use XPathDocument class. Search for it in google or this site for examples.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
Have a look at the XPath tutorial at www.zvon.org. The XPath for attributes uses the @ symbol, so the XPath to get the school name attributes is: /test/school@name.
Using this in .NET (C#):
XmlDocument test = new XmlDocument();
test.LoadXml(pathToXmlFile);
// to get just the first (or a school at any position) school name, use [position] in the XPath
TextBox.Text = test.SelectSingleNode("/test/school[1]@name").InnerText;
// to get all school names
XmlNodeList list = test.SelectNodes("/test/school@name");
foreach(XmlNode node in list)
{
// process nodes here....
}
|
|
|
|
|
I have a custom component i am using in my project. It's base is entirely covered with panels and other components. When i click on it, it is the child component that is activated rather than the base component.
Is there any way to determine when a child of the base component is activated via the base component? I know it could be done with an event for each of the child components that check a variable on the base component. But i'm looking for a simpler way that fires a single event for gotfocus and leavefocus.
Note: I'm trying to make this component entirely self contained, so i'd like to implement this inside the component, rather than the parent form.
Cheers
Cata
|
|
|
|
|
The Catalyst wrote:
Is there any way to determine when a child of the base component is activated via the base component?
You mean container? "base" component is something entirely different, i.e. the base class of a derivative class.
Only one control can have focus at a time. This is universal in all window managers. Container controls can, however, receive notification messages from their child controls, although you may have a problem if you're using containers within containers.
Your container control should extend from ContainerControl , or most often one of its derivatives, UserControl . Other controls can handle the following as well, though, so long as they're parent to controls for which you want to receive messages. Again, this is rooted in Win32, so experience with Win32 programming is beneficial.
Just override the WndProc of your container. You'll get notification messages for most child control notification messages as well, so you'll need to distinguish between the handles using the Message.HWnd . You can always get a control from it's handle using the static Control.FromHandle method, too.
Keep the message handling efficient and be sure to call base.WndProc with the reference to the Message struct passed to you when done, otherwise messages won't be dispatched to their destination windows (controls) and nothing will work inside of that container.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm trying to set a control up so that it has rounded corners like a windows form. I have enabled opaqueness, and create a bitmap with alpha textures in the corner possitions. However, the components behind the current instance do not show up, instead I am left with the corners displaying the containers background.
I know that the documentation for ControlStyles says:
Note: If there is another control between the control and its parent, the current control will not show the control in the middle.
Does anyone know of a way around this? Would it be possible to blend a controls image onto the background texture when it is moved?
Cata
|
|
|
|
|
If you want to apply Visual Styles to a button like that which is applied to forms in Windows XP and newer, then P/Invoke and use the Theme API, which is documented on MSDN (lookup OpenThemeData ).
If you're looking for information about how to owner-draw atypical buttons, search CodeProject for many examples (including a pretty decent one for Aqua buttons, or those used in Mac OSX).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
If you are looking to apply the Windows XP Visual Styles, you may want to take a look at Don Kackman's article[^] here on CodeProject. He used Managed C++ to create a .NET wrapper for the Theme API that Heath mentioned.
Hope that helps.
--Jesse
|
|
|
|
|
I am trying to read/write stored information in a class to a file. This particular class contains 8 DataColumn variables, which are put into a DataTable. How do I serialize and deserialize this information? It won't write or read the columns themselves, and naturally not the DataTable. I'm lost!
Another Question:
I'm still very new at C#, 5 days using it maybe. The current application I am writing will run on 4 or 5 different computers and all share the same data. Is there an easy way to do this in C#? If so, how...and just ignore the first question
Thanks for the help.
|
|
|
|
|
Search for SerializableAttribute Class in MSDN and this site or google. There is an example in MSDN.You can find more here and in google.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
While you can using either runtime serialization (System.Runtime.Serialization ) or XML serialization (System.Xml.Serialization ) (there is a fundamental difference, and runtime serialization is much more powerful), it's much easier to use DataSet.ReadXml and DataSet.WriteXml to read and write XML, respectively. See the documentation for those two methods for more information.
If you're sharing data between clients, then there's many things you can do. For one, you can use a database (like SQL Server, in which case use System.Data.SqlClient classes, or MS Access or another database with OLE DB drivers, in which case use System.Data.OleDb ...and ODBC and Oracle as specifically supported as well). You could also use .NET Remoting, although this is a pretty advanced topic. Make sure to pick up a book on .NET Remoting, such as "Microsoft .NET Remoting" from http://www.microsoft.com/mspress[^] or "Advanced .NET Remoting" from http://www.ingorammer.com[^]. There's also Web Services, which use HTTP as the transport, but .NET Remoting can give you two-way communication ability (if using a transport channel like the TcpChannel, not the HttpChannel which is, by nature, "one-way", or client request/server response based), meaning that you could have clients handle remote events to know when data has been updated, for example.
The database will definitely be easier and the DataSet serves well in that case, since it represents a disconnected recordset. There's a lot of designer support in VS.NET for data-driven applications, but read about ADO.NET so you understand what's happening behind the scenes.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a gif file, 256 colors, created with Paint Shop Pro.
I do
// Load the bitmap
Bitmap myBitmap = new Bitmap ("toto.gif");
// Cut it
Bitmap frame = myBitmap.Clone(Rectangle);
// Save individual frames
frame.Save("Frame1.gif", Imaging.PixelFormat.Gif);
It works OK. Latter, I want to load the saved frame
// Load the frame again
Bitmap frame = new Bitmap("frame1.gif");
This works also. But, if I try to save it again
frame.Save("Frame2.gif");
I got an external exception in InteropServices, telling me there was a problem with GDI+.dll.
Anybody had the same problem?
|
|
|
|
|
I'm not sure exactly what you're trying to do (which may help to understand the problem and help you solve it), but take a look at the Image.SaveAdd method (which Bitmap would inherit, of course) to see how to save individual frames of an animated GIF, which I'm guessing is what you're trying to accomplish.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a storyboard, a single image that contains several frames. My program cut this storyboard in individual frames, of variable size.
I now want to save these individual frames in separate files.
This part works. The gif are indeed saved.
Later I need to make copies of some of these files, after I've done some processing on memory on them.
So I start by loading the individual frames doing
Bitmap bitmap = new Bitmap("Frame1.gif");
// Then some processing
// Then I save it again
bitmap.Save("Frame1.gif", PixelFormat.gif);
And there it crashes. I have tried to do the save immediatly after the load, in case my processing was messing something, but it still doesn't work.
Conclusion: I cannot save a bitmap immediately after I load it?
|
|
|
|
|
That is weird, and I frankly don't know the answer to that. But there is a better, more efficient way of copying files anyway: File.Copy .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Search on Google groups, I had the same problem a few years back. Sorry I cant recall the resolution though
top secret
|
|
|
|
|
Hello,
I have a question on Remoting that follows:
My first server configuration file has entry:
<service>
<wellknown mode="Singleton"
type="RemotingSamples.RemoteClass1,RemoteObject"
objectUri="ServiceEndPoint" />
</service>
My second server configuration file has entry:
<service>
<wellknown mode="Singleton"
type="RemotingSamples.RemoteClass2,RemoteObject"
objectUri="ServiceEndPoint" />
</service>
Now my client configuration file has entry:
<client>
<wellknown displayName="Server1"
type="RemotingSamples.RemoteClass1,RemoteObject"
url="tcp://machine1_ipaddress:8080/ServiceEndPoint" />
<wellknown displayName="Server2"
type="RemotingSamples.RemoteClass2,RemoteObject"
url="tcp://machine2_ipaddress:8086/ServiceEndPoint" />
</client>
I want user to select the server by giving server's machine ipaddress.
Once he gives me the machine_ipaddress I want to create object
of the class the selected server implements, that is when,
machine1_ipaddress is given I have to create instance of RemotingSamples.RemoteClass1
and
when machine2_ipaddress is given I have to create instance of RemotingSamples.RemoteClass2.
How do I do this?
Please give me more details (A simple implementaion if possible.)
|
|
|
|