It worked Thank you! :D
Emmet_Brown
Posts
-
Keyboard input handle problem -
Keyboard input handle problemHi all, I want to close the from with a keyboard input 'K' but I cannot handle the input. Before asking here, I've done lots of researches on web and especially on msdn. This is not the first time I've been using KeyDown event but now I'm on a new computer and I cannot figure out why this time it does not work. my code is simple:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.K)
{
this.Close();
}
}and on the designer side:
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
All other events work just fine, like MouseOver, MouseDown or MouseMove but when it comes to KeyDown or KeyPress, it doesn't work any suggestions? :( -
ExecuteNonQuery problem? [modified]Sorry everyone I figured out that I was working on another dataBase with my querybrowser I just duplicated the databases and that fooled me in the first place I wasn't aware of the difference until 3 hours of crisis sorry for disturbance :) thanks for any help
-
ExecuteNonQuery problem? [modified]Thank you but, The statement is forming correctly, I'm copying the text into query browser and executing it's working there
-
ExecuteNonQuery problem? [modified]Hello everyone I've generated an SQL statement in my .cs file as cmd.Connection = conn //this is working, worked before in the same code cmd.CommandText = "INSERT INTO VALUES ('value1','value2')"; conn.Open cmd.ExecuteNonQuery conn.Close the problem is: I'm checking the SQL statement in debug, copying the same query on my MySQL QueryBrowser and executing the same string works in the querybrowser, but in ExecuteNonQuery() doesn't what can be the problem? notes: 1-connection is done, checked, and double checked, a few lines earlier, several SELECT statements are executed and worked 2-connection string is not changed before this code, it was the same before 3-I'm not changing the code while copying to the Querybrowser, taking the text as it is directly from debug window and pasting it to the SQL browser tool. any ideas?
modified on Tuesday, October 19, 2010 2:39 PM
-
Grouped ordered precise select statement?Couldn't find a single query to do all above, but decided to do it C# style thanks all anyway :)
-
Grouped ordered precise select statement?Hey! :D be sure that I've done that before I ask to you guys =) I'm googling and querying at the same time :)
-
Grouped ordered precise select statement?well, there are lots of fields in this table and some of them are "for, against"...etc I'm adding those to my query as well, now, just think that Point column is unique :D btw, thanks for the answer, I'll have a look at it
-
Grouped ordered precise select statement?I would appreciate any answer that makes the full query above but with some brute coding, I can handle myself in .cs part of the project if you only tell me how to get a "SECOND HIGHEST" from a table for the highest of A's, I'm using
SELECT ID as row, Team, Point FROM cadet_games.volleyballpool8 WHERE Pool = 'A' and Point=(select max(point) from cadet_games.volleyballpool8)
If I don't get answer soon enough, I'll have to use multiple dataTables to concat later. But still I need some "second highest" query :( -
Grouped ordered precise select statement?Hello everyone I have a table named "volleyballpool8" it has columns as ID, Pool, TeamNo, Team and Point There are 11 rows in this table and there are 4 different "Pool"s, as A,B,C and D Now I need to make a SELECT statement to form a table, which: 1-Gets the ID, Team and Point of the row with the HIGHEST "Point" value of Pool='A's 2-adds the ID, Team and Point of the row with the SECOND HIGHEST "Point" value of Pool='B's 3-adds the ID, Team and Point of the row with the HIGHEST "Point" value of Pool='C's 4-adds the ID, Team and Point of the row with the SECOND HIGHEST "Point" value of Pool='D's Therefore, in the end, I'll have a 4 rowed table I'm somewhat new to SQL and I got confused... Can anybody help? :doh: btw: all of the fields are strings
-
Ordered selection of 2 columns in single SQL querythanks for help but I decided to take all the data to a DataTable and then sort it in the C# part of the project, the hard way =) thanks again
-
Ordered selection of 2 columns in single SQL queryHey, I have a table named volleyballsecondround8 which has columns like 'Winner', 'Loser' and 'MatchNo'. I'd like to make a SELECT statement as it takes the 'Winner' where 'MatchNo'='M20' and puts it ind the [0]. row of my new table, then takes the 'Loser' of 'MatchNo'='M20' and puts it into the second row. Therefore; When I execute a query on volleyballsecondround8 like the following:
Select @row := @row + 1 as row,Winner,Loser
from volleyballsecondround8,(SELECT @row := 0) r
Where MatchNo IN('M20','M19','M18','M17') OrderI get e resultant table like: ROW-Winner-Loser ---------------- 1-India-Luxemburg 2-USA-Spain 3-Turkey-Argentina Where, I want a table like: ROW-TEAM ----------- 1-India 2-Luxemburg 3-USA 4-Spain 5-Turkey 6-Argentina any help?
-
"Unable to load the project file xx.csproj"Thank you in advance :) I checked the projectName.csproj file, nothing seems wrong. but something new came up... When I opened Visual Studio by itself (without indirectly running it by a .sln file) at first, it gave some errors about forms designer tool...etc after those, I selected new--> project-->C# windows forms project to compare the csproj file, but nothing happened :S a new project did not created, nothing happened as if I did not select new-Project wow it seems like Re-Restore or Re-Install is the only problem :S "if nothing is obvious, you could try creating a new empty project and then include the files in to it and save that (the project should be for the same platform, e.g. if it's WPF you need the WPF dlls so create an empty WPF project)." This was my last solution but after this new project creation problem, re-installing seems to be ineviatble :(
-
"Unable to load the project file xx.csproj"first, Thank you =) I took a look to the link and tried some of the tips that mentioned in there, but did not work for me. By the way, the project itself seems normal, there aren't any missing visible files, it just won't open. When I double click the ".sln" of the project, it gives the "unable to load blah blah.csproj" error :(
-
"Unable to load the project file xx.csproj"Hi everyone This morning I needed to use "System Restore" to yesterday. I completed a project yesterday but when I try to open the project (Visual Studio 2008, C#), it says "Unable to load the project ProjectName.csproj" What can be done? does anyone has any solutions? :(
-
Modfying Print Documentno one :( ?
-
Modfying Print DocumentThank you but it seems like PrintPage event is more likely used for adjusting the margins or determining the printable boundaries; generally features about the document. I think I just need to decrease the font size of the text in the printed document. any idea?
-
Modfying Print DocumentHi everyone; I want to add some information on my print document. To be precise I'm printing my DataGridView like this:
private void button5_Click(object sender, EventArgs e)//YAZDIR
{
if (SetupThePrinting())
MyPrintDocument.Print();
}private bool SetupThePrinting()
{
PrintDialog MyPrintDialog = new PrintDialog();
MyPrintDialog.AllowCurrentPage = false;
MyPrintDialog.AllowPrintToFile = false;
MyPrintDialog.AllowSelection = false;
MyPrintDialog.AllowSomePages = false;
MyPrintDialog.PrintToFile = false;
MyPrintDialog.ShowHelp = false;
MyPrintDialog.ShowNetwork = false;if (MyPrintDialog.ShowDialog() != DialogResult.OK) return false; MyPrintDocument.DocumentName = "Customers Report"; MyPrintDocument.PrinterSettings = MyPrintDialog.PrinterSettings; MyPrintDocument.DefaultPageSettings = MyPrintDialog.PrinterSettings.DefaultPageSettings; MyPrintDocument.DefaultPageSettings.Margins = new Margins(40, 40, 40, 40); if (MessageBox.Show("Verilerin sayfaya ortalanmasını istiyor musunuz?", "Baskı Özellikleri - Sayfa Ortalama", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) MyDataGridViewPrinter = new DataGridViewPrinter(dbGridView, MyPrintDocument, true, true, "KASA DÖKÜMÜ\\n\\nbakiye:"+label17.Text+" gelir:"+label19.Text+" gider:"+label18.Text+"", new Font("Tahoma", 10, FontStyle.Bold, GraphicsUnit.Point), Color.Black, true); else MyDataGridViewPrinter = new DataGridViewPrinter(dbGridView, MyPrintDocument, false, true, "KASA DÖKÜMÜ\\n\\nbakiye:"+label17.Text+" gelir:"+label19.Text+" gider:"+label18.Text+"", new Font("Tahoma", 10, FontStyle.Bold, GraphicsUnit.Point), Color.Black, true); return true; }
So, I need to make two changes: 1. I need to add a line to the end of the document to put the information on my label#'s, how to put this line properly ( if possible such as:
"The information is" +label7.text+ "
format) 2. Because of the number of columns, my document prints 6 pages for a 3-paged information. also uses first 3 pages for first 4 columns, and the last 3 pages for the rest of the columns. Reducing the character size in the print document could be a solution, but I don't know how to do that either. Can anybo -
form design / update clashthanks =) but the solution is to use Convert.toString(anydouble) instead of anydouble.toString() :)
-
form design / update clashHello, In my form, I set a label's initial text as 0. in the Load() of this form, I make some calculations and then set the label's text to the output of these calculations. When I debug, I trace the calculations and nothing seems to be wrong. I tried to change the initial value of the label and I saw the new initial value in the runtime.
for (int i = 0; i < dbGridView.Rows.Count; i++)
{
if (dbGridView.Rows[i].Cells[4].Value.ToString() == "Nakit")
{
top = top + Convert.ToDouble(dbGridView.Rows[i].Cells[7].Value.ToString());
}
}
label5.Visible = true;
label5.Text = top.ToString().Substring(0, 10);I'd like to sum the value in 7th cells and then convert the sum to string, and set the label with this. In debug, I see that 'top' is calculated properly but I cannot see the calculated value in the label in runtime. Anyone can help me? this is urgent :(