with GraphicsPath.AddEllipse i created ellipse,if i use GetBounds() i get the bounds of the ellipse,
now if i want to rotate the ellipse keeping the same bounding rectangle how do i calculate the new ellipse to create?
I have a problem, i have created a form and a user control. I have a database on SQL server. I have a combobox on my usercontrol and i would like to implement my combobox with my database. i've used the properties of the combobox to choose the datasource and choose my database and the right table but my combobox is empty.
Whereas if i create a combobox in my form and did the same things with my combobox i have the data inside.
I've tried lot of things but nothing is working , if someone know how to do this i would be very grateful
I don't have any error, it just that i have no data in my combobox.
For the code i'm using the wizard datasource in the combobox propriété in Visual Studio.
The wizard create a dataset ( with the name of my database), a Bindingsource and a TableAdapter ( with the name of the table i want)
I can show you some code of one of this composant if you want?
DoDragDrop() is the method you need to call to make this work. You can either put a string (of the filename of the image) into the drag drop object, or stuff the whole bitmap in, depending on whether you just want to drag between instances of your application, or with any app that supports dragdrop
Why not? You can store anything in an xml file. Just use your favourite flavour of XML serialization. Or just do it manually to make sure it works exactly the way you want it to work.
Your Select does not really make sense to me, why did you put that in?
Well no wonder, you first make it into base64, and then use that as raw bytes - that does not make any sense in any way.
If you want to use ReadAllBytes, then at least pass the bytes to the MD5 object as bytes. Or if you have to use base64, decode it first System.Security.Cryptography.MD5 has a ComputeHash which takes a Stream as argument.
Why you are converting the byte array into a base-64 string and then calculating the hash on the string? You can calculate the hash directly on the byte array, probably that is the reason because your hash in incorrect.
Also, why you are using Regex.Replace instead of the regular string.Replace?
For your 2nd problem, you can calculate the hash on a stream instead than on a byte array (that has a limit of 2Gb).
The following code summarizes what you have to do:
public static string MD5Hash(string filename)
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
using (Stream stream = new FileStream(filename, FileMode.Open, FileAccess.Read))
return BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "");
Luc Pattyn [Forum Guidelines][My Articles] DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
Please I need help on this problem.
I have an application am writing using visual c# 2008. The isuse is this I want connection string to the database to be read from a file save elsewhere on the system because after package and installation of the application if there is any changes in the connection parameter i will just change it in the file insted of changing it in the code and package it again. Onformload, he read the connection file and connect to database.
Did you ever heard of the App.config? Click on your project in VS, select "Add new element" and choose "application settings file" from the dialog. You can access the config with System.Configuration.ConfigurationManager.ConnectionStrings.