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.
You must also encrypt your connection string before write it to a file.
You don't want anybody to know your database password, do you
You can't make it impossible. If you encrypt it, well, your program would contain the code to decrypt it. And they will have that code.
The same problem applies to all local data and is impossible to solve, though you could make the chain of encrypted keys of arbitrary length to slow the attacker down.
Edit (used to be something here about encrypted connection strings): scratch that, it's just impossible as well. Great. So now we know you don't even need to try to hide your connection string, at least that saves us all some effort.
I would use App.config aswell as SeMartens describes, but if you prefer to use a seperate file other than App.config, why not make the main program retrieve the connectionstring from a seperate class with a static method and just have that as a dll file. Then if the connectionstring should change you only have to replace the dll with a new one.
modified on Saturday, June 20, 2009 5:15 PM
Last Visit: 31-Dec-99 18:00 Last Update: 18-Jun-21 13:50