|
You should assert that the method does what it is supposed to do.
Does it change state?
print stuff to the screen?
remove stuff from a list?
try make it assert the intended actions of the method.
|
|
|
|
|
hi all
i want to select the second cell in datagridview rows, and when new row was add must select the same index.(2nd cell).
thanks all
zz
|
|
|
|
|
hy everyone!
i need your help because i am stuck.
i do have bitmaps which are each stored in a byte[]. i want to merge them to a single multipage tiff. does anyone of you have a solution how to do this? (maybe a link to a project where this was done)
thanks.
stephan.
|
|
|
|
|
I don't think .NET supports this, perhaps a library like Atalasots is needed ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
hi all
i wount to select the Cell Number 5 on row Number 3
Who i can do that ?
thanks for any boudy hellp me
zz
|
|
|
|
|
Hi all,
I'm using Visual Studio 2005 (.net 2) to build my Windows application.
Now, I don't understand the effect of changing screen DPI.
My application is a card designer that uses forms as body of card and controls on it as contents of card.
When I change DPI from 96 to 120 the controls of application forms looks larger, but the contents of the card looks smaller.
Please help
|
|
|
|
|
Hi,
I am currently stuck up with an issue as to how to select a data structure for my application.
i will have around 16,00000 entities to be stored and one from them has to be retrieved. So i make use of the hashTable class in dotnet. Now i would like to know whether the hash-table has any limitations.
|
|
|
|
|
If the count of entities is dynamic, but can grow up to 1600000 items, you should use the HybridDictionary. It stores the name/value pairs in an very efficient way. This Dictionary uses the ListDictionary for small count of items and switches automatically to Hashtable if the count grows to a large amount of items. (Sorry, i dont know the Limit when this happens)
Hope this helps
Der Staat mit der niedrigsten Geburtenrate ist nicht die Bundesrepublik, sondern der Vatikan.
|
|
|
|
|
how to serialize a standard control like text box or a button control
|
|
|
|
|
It's rarely useful to serialise something like a UI control. What is it that you are trying to do?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Can't you just do it like you would any other object?
BinaryFormatter formatter = new BinaryFormatter();
FileStream output = new FileStream(@"C:\testfile.txt",System.IO.FileMode.Create);
formatter.Serialize(output, theControlToSerialize);
Not sure why you would want to do this though.
Simon
|
|
|
|
|
I've been working on an programe wich uses MySql 5,
The programe runs an MySql to reads the data from the database and also an seperate sql to add new data to the DB,
Tough for some reason the Sql for adding is not working proply, It wont add any data and it doesn't disaply an error message. And yes i have acces because i can read data in the DB,
Here's is my Sql code:
string query = "INSERT INTO gebruikers (klantnr, voornaam, tussenvoegsel, achternaam, wachtwoord, adres, email, actcode, status, pcpw, land, telefoon , betalingskeuze, betalingsmethode) VALUES ('" + txtVoorNaam.Text + "', '" + txtTussenVoegsel.Text + "', '" + txtAchterNaam.Text + "','" + txtPW.Text + "','" + txtAdres.Text + "','" + txtEmail.Text + "','" + txtActCode.Text + "','" + cmbStatus.Text + "','" + txtPcWp.Text + "','" + cmbLand.Text + "','" + txtTel.Text + "','" + cmbBetaalKeuze.Text + "','" + cmbBetaalMethode.Text + "')";
MySql.Data.MySqlClient.MySqlCommand bQuery = new MySql.Data.MySqlClient.MySqlCommand(query, connection);
I also have another form wich has similair content and there the Sql runs with out problem.
There the code looks as follows
string query = "INSERT INTO bestelregel (productnummer, aantal_besteld, bestelnummer, user, datum, produktnaam, nieuw) VALUES ('" + txtProductNr.Text + "', '" + txtAantalBesteld.Text + "', '" + txtBestelNr.Text + "','" + txtUser.Text + "','" + dtpDatum.Text + "','" + txtProduktNaam.Text + "','" + cmbNieuw.SelectedItem + "')";
MySql.Data.MySqlClient.MySqlCommand bQuery = new MySql.Data.MySqlClient.MySqlCommand(query, connection);
My Question is what i'm i doing wrong with the "gebruikers" table?
Cause i cannot find it
Thanks in adavance for any help or suggestions
|
|
|
|
|
1.Please reformat your post so that it doesn't stretch whole website.
2. Try running the query manually in mysql administrator to see what result you will get.
3. You should be using parametrized queries to avoid sql injection attacks and problems with escape characters. It will also increase performance of your queries. See this article: SQL Injection Attacks and Some Tips on How to Prevent Them [^]
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
You don't show any code for actually executing the command. Have you remembered to do that for the insert?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello,
I have a string "<sip:username@10.10.10.10:5060>"
I would like just to get the "username", and nothing else.
<br />
string callStatus = "<sip:username@10.10.10.10:5060>";<br />
string usernameAndIP = callStatus.Remove(0, 5);<br />
string[] username = usernameAndIP.Split('@');<br />
this.lblCallStatus.Text = username[0].ToString(); <br />
I am using this code above. But and just Interested if there is a better more efficient way to do this.
Just looking to improve my code if that is possible, and also will this work for every situation that could arise. For example if the port number hasn't been included.
Many thanks,
|
|
|
|
|
You can use extract username using Substring method of string class.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
split your string on : and @ it will return u a string array...
and on 2nd index u will find the username
|
|
|
|
|
<[^:]+:(?<username>[^@]+)@(?<ip>[^:]+)(:(?<port>\d+))?>
This regular expression should work for most cases, it will include the username, ip and port (if given) in the named groups "username", "ip" and "port"
/edit: why does this board include smilies in code and pre tags? Annoying! Just imagine the smiliey being ": (" (without space)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi ,
I want to enter date to a text box and automatically view it like this
01/02/2008
please..How to do..
Regards
|
|
|
|
|
DateTime theTime = ...;
myTextBox.Text = theTime.ToString ("d"); /ravi
|
|
|
|
|
Thanks a lot for help …
but I meant that
Some user need to enter date to a text box and the last should format that date and show the slash "/"
|
|
|
|
|
try a masked text box.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Maybe something like this in the text changed event?
if (textBox1.Text.Length == 8)
{
StringBuilder sb = new StringBuilder();
sb.Append(textBox1.Text.Substring(0, 2));
sb.Append("/");
sb.Append(textBox1.Text.Substring(2, 2));
sb.Append("/");
sb.Append(textBox1.Text.Substring(4, 4));
string displayString = sb.ToString();
DateTime tmpDateTime;
if (DateTime.TryParse(displayString, out tmpDateTime))
{
textBox1.Text = displayString;
}
else
{
MessageBox.Show("Invalid input.");
textBox1.SelectAll();
}
}
Dave
|
|
|
|
|
I was going to suggest using a masked text box or handling the lose focus event, but others have beat me to it and even provided a solution. One change I would make to Davey's suggestion is to use an ErrorProvider instead of a message box.
/ravi
|
|
|
|