Hi, To change the font : - right click on the console title bar - select properties - Select the Font Panel and change the font. HTH. Hayder Marzouk
Hayder Marzouk
Posts
-
Who knows how to change font in console? -
Data binding using checkboxHi, This can be resolved using Format/Parse handlers. Here the code :
Binding YesNoBinding = new Binding("Checked", yourDatasource, "YourPropertyName", false, DataSourceUpdateMode.OnPropertyChanged); YesNoBinding.Format += new ConvertEventHandler(YesNoBinding_Format); YesNoBinding.Parse += new ConvertEventHandler(YesNoBinding_Parse); yourCheckBox.DataBindings.Add(YesNoBinding);
And here the code for handlers :void YesNoBinding_Parse(object sender, ConvertEventArgs e) { if ((bool)e.Value == true) e.Value = "Y"; else e.Value = "N"; } void YesNoBinding_Format(object sender, ConvertEventArgs e) { if ((string) e.Value == "Y") e.Value = true; else e.Value = false; }
HTH. Hayder Marzouk -
Paintdesktop Api with back bufferHi, I Created an application that allows user to draw shapes, pictures,... I had also flickering problem and a single line of code resolved my problem. Try this line in the Initilization of ure Control/Form : SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); Change the first argument to ure needs. HTH. Hayder Marzouk
-
How to send variable from aspx.cs page to aspx pageHi, - Declare your variable as public in the aspx.cs - in your .Aspx use : <%=myVar%> in any place HTH Hayder Marzouk
-
MySQL connection problemHi, You have downloaded MySQl connector, so use it instead of oledb. It's a native driver and fully managed .Net so more performant than oledb driver. HTH. Hayder Marzouk
-
SQL triple-join questionHi, Many ways to write the query : 1- using "IN" : select userid from tblusers where userTeamId in (select teamId from tblTeams where teamOfficeId in (select officeID from tblOffices where officeId= 'XYZ')) 2- Using Join (more recommended) : SELECT tblUsers.userID FROM tblUsers INNER JOIN tblTeams ON tblUsers.userTeamId = tblTeams.teamId INNER JOIN tblOffices ON tblTeams.teamOfficeId = tblOffices.officeId where tblOffices.OfficeId = 'XYZ' HTH. Hayder Marzouk
-
Autocomplete File PathHi, These feature is implemented in .Net framework 2.0 but not in .Net 1. Here a usefull link that contains some code to implement Autocomplete feature : http://blog.theple.com/neoworkadmin/folder/13.html?uid=65[^] Go to the section : Ability to add Auto-Complete to any Text Box HTH. Hayder Marzouk
-
Duplicate record from Datagrid.Hi, To find duplicated records use the above code sample : DataView v = myDataSet.Tables["YourTable"].DefaultView; v.Sort = "YourPrimaryKey ASC"; Dictionary> duplicatedRecords = new Dictionary>(); for (int i = 0; i< v.Count -1; i++) { int j = i +1; object iValue = v[i]["YourPrimaryKey "]; while (v[j]["YourPrimaryKey "] == iValue) { if (! duplicatedRecords.ContainsKey(i)) { duplicatedRecords.Add(i, new List()); } duplicatedRecords[i].Add(j); j++; } i = j; } HTH. Hayder Marzouk
-
Supress main report section with subreportHi, Try right cliking onthe report and selecting Format Section Check the case Suppress Blank section HTH. Hayder Marzouk
-
Querying Microsoft Active Directory (Windows Server 2003) from SQL ServerHi, Visit this blog : http://adsdsoobject.codebetter.com/blogs/brendan.tompkins/archive/2003/12/19/4746.aspx[^] Here also a complete article : http://fromelard.free.fr/Scripts/SQL_Linked_AD/SQL_Linked_AD.pdf[^] Unfortunatly it's in french. I can help u translating it if u want. HTH. Hayder Marzouk
-
Problem Displaying moneyfield in gridviewHi, My response works in a .Net 2.0 Windows Forms application not is an ASP.NET Project. So... - Edit the gridview columns - Select ure column - Select the property DefaultCellStyle and click the button in the right. - You will find the Format property in a new opened property form - Set the property to c HTH. Hayder Marzouk
-
problem.Hi, Here an example. U have 2 dlls : DLL1 and DLL2. In DLL1 u have a class Employee with a method Fire() In DLL2 u have a class Boss. 1- if u declare the Fire method as protected, in the boss class u can invoke the Fire method and U cannot invoke the fire method anywhere else the Boss class 2- if u declare it as Internal : u can invoke the fire method anywhere in DLL1 but not in DLL2. U cannot also view the method in the Boss class (because it's in the DLL2) 3- If u declare it as Internal protected, u can only invoke the method from a class inheriting from Employee located in the DLL1. HTH. Hayder Marzouk
-
DataGridView problemhi, Don't think datagrid, think datasource. So ure solution is in the the datatable. use the ColumnChanged or ColumnChanging event of ure datatabl. Here an example : mydataTable.ColumnChanged += new DataColumnChangeEventHandler(mydataTable_ColumnChanged); void mydataTable_ColumnChanged(object sender, DataColumnChangeEventArgs e) { if (e.Column.ColumnName == "Primary" ||e.Column.ColumnName == "Secondary") { if (e.PropsedValue == true ) { //............. do something } } } HTH. Hayder Marzouk
-
Problem Displaying moneyfield in gridviewHi, Set the DefaultCellStyle.Format property of the column to c HTH. Hayder Marzouk
-
problem when creating database independant access layerHi, In fact they are different : SQLServer provider : @ + name Oracle : p + name OleDB : ? (without a name) ODBC (i think) : ? (without a name) Me too i don't know why MS decided to change parameter names with providers. It's as is it and we must deal with that. There are many other differences : - Data Types - Quotes : []in sql and access , "" in Oracle,.... - And Queries are different so use only standard SQL (SQL-92 or SQL-99) to be sure that u don't need to rewrite your application when changing provider. I think u must create a class for each provider and declare diffrences as variables that u change in each class. I am sure that's the better way. HTH. Hayder Marzouk
-
Converting seconds to hours and minsHi, Here some sql to calculate Hours, Minutes, seconds using only built in sql functions and in one sql select statement: select floor(duration / 3600) as h, floor( (duration - floor (duration /3600) )/60) as m, duration - floor(duration / 3600) * 3600 - floor( (duration - floor (duration /3600) )/60) * 60 as sec then u can concatenate all these fields HTH. Hayder marzouk
-
get data in background for datagridviewHi, Use VirtualMode option of the datagridview. U can find examples in the MSDN HTH. Hayder Marzouk
-
Wheres my data when app.config is an Embedded ResourceHi, It saves it somewhere in C:\Documents and settings\UserName\LocalSettings\Application Data \Your Application Name .Exe XXXXXXXXXXXXXXXXXXXXXXXXXXX\VersionNumber\user.config Try search *.config in your documents and settings and u will find it. That's because .Net wants to save Config settings for each Windows user. so it does not touch the application.config file that can be shared between many users. That happens even u don't set the Build action to Embedded Resource wich is not logic because the config file must not be embedded in the exe. HTH. Hayder Marzouk
-
deleting an sql databaseHi, When u cannot delete a database that means that a connection to the database is still alive. - If u want to delete it from SQL Server Entreprise manager, do the following : 1- Right click on the database 2- Choose All tasks \ Detach database 3- U can see the number of connections to the database. Click on the Clear button to force open connections to disconnect. 4- Do not detach the database but click on cancel and now u can delete the database. - If u are deleting the database from SQL Query Analyzer be sure to be not connected on the database to delete. Choose the master database in the combobox. To delete the database just execute the query : Drop database YourDatabase. - If ure using .net to delete the database. U must turn off Pooling in your connection strings. That's because even u close all connections by using Connection.Close() method, connections still open for performance reasons. HTH.
-
Synchronizing Sql 2000 database. Need help.Hi, U can use the Replication feature built in SQL Server 2000. Here a goog article about it : http://www.devarticles.com/c/a/SQL-Server/Replication-SQL-Server-2000--Part-1/[^] HTH