Wednesday, September 22, 2010

Rotate text in textboxes in rdlc reports

Set WritingMode to Vertical

WritingMode indicates whether the text is displayed horizontally or vertically.

it will make your text like this http://picskip.net/u/22094829.png

Tuesday, September 21, 2010

Report Parameters Missing in VS2010?

A. Open your report.
B. Click on the 'View' menu
C. Select 'Report Data'

Shortcut for this Ctrl+Alt+D

In VS2008 it was in Report's Property page as "ReportParameter"

Wednesday, June 16, 2010

Tuesday, June 8, 2010

SQL Server Compact 3.5 Toolbox

SQL Server Compact 3.5 Toolbox add-in for Visual Studio 2010. This add-in adds several features to help your SQL Server Compact development efforts: Scripting of tables and data, import from SQL Server and CSV files, and others to come.

Wednesday, May 26, 2010

Reset table identity column

DBCC CHECKIDENT(Product,RESEED,0)
Where Product is my table name

Difference between TRUNCATE & DELETE

About TRUNCATE
--------------
Much faster than Delete.
Can't be rollback.
Can't use where clause with it.
Can't use on a linked table. (When use on a table which is linked to another table you will see this message "Cannot truncate table 'TableName' because it is being referenced by a FOREIGN KEY constraint."

After using TRUNCATE all of the memory space is released back to the server.


About Delete
--------------
Slower than TRUNCATE.
Can be rollback (as its a DML operation).
Can use where clause with it.

After using Delete Command The memory will be occupied till the user does not give ROLLBACK or COMMIT.

Wednesday, April 28, 2010

Hard Reset, Full Format, Factory Default your N86

1. *#7780# - Restore factory settings - resets all the settings to the default ( you will not lose any data)
Make sure you back up your data as you will lose all of it when you perform option 2 or 3 on this list. The default code for ALL operations listed here is 12345

2. *#7370# - Reformat your phone (out of the box, tho keep in mind that most newer nokia phones at least n series, e series and s60 based phones have udp - user data preservation so not ALL data may be lost. still it is a good idea to always do a back up of your stuff.)

3. This you perform as a last resort. Nothing else is working.If the phone is not showing any activity, proceed with hard formatting , turn off your phone, hold the following buttons while pressing the power button. (the default code is 12345)
hard reset - hold the following buttons *, 3 (number button) and talk/green key. turn on the phone and do not release those buttons until you see the Nokia boot up screen. once you feel the phone power up you can let go off the power button while still holding all three buttons.

If these codes are not working the only thing for you to do is contact your Nokia Care Center/Service for assistance.

Tuesday, April 13, 2010

Access 2003 - Missing Menu Bar

RESTORE MISSING MENU BAR:-
* right click the Tool Bar and select 'Customize'
* select the Toolbars tab and then click on 'Properties'
* goto the 'Selected Toolbar' dropdown and look for 'Menu Bar'
* click 'Restore Defaults' and, Hey-Presto, just like magic the Menu Bar appears.

Monday, March 22, 2010

Me.Controls in WPF

Use the parent control children property.
below Main is my grid name which contains saveral controls (some of them are textboxes)

For Each Control As Control In Main.Children
If Control.GetType.ToString() = "System.Windows.Controls.TextBox" Then
Control.BorderBrush = Brushes.Gray
End If
Next

Sunday, March 14, 2010

T-SQL Loop (Fetch)

DECLARE @Event_ID int

DECLARE my_cursor CURSOR FOR
SELECT Event_ID FROM ITS_CALENDAR_EVENTS_LIST
WHERE EVENT_SA_Flag = 1

OPEN my_cursor

FETCH NEXT FROM my_cursor
INTO @Event_ID

WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO ITS_CALENDAR_EVENTS_TO_FLAGS (Event_ID, Event_Flag_ID)
VALUES (@Event_ID, 1)

FETCH NEXT FROM my_cursor
INTO @Event_ID
END

CLOSE my_cursor
DEALLOCATE my_cursor

Monday, March 8, 2010

Assign datatable to combobox WPF

.XAMAL Code
ComboBox Height="23" HorizontalAlignment="Left" Margin="6,90,0,0" Name="cmbPlaceOfWork" VerticalAlignment="Top" Width="191"
(put xamal tags, < before ComboBox and /> after "191")

.XAMAL.vb Code
01-Imports System.ComponentModel

02-Private Sub FillPlaceOfWork()

Me.cmbPlaceOfWork.ItemsSource = (CType(DBRelated.GetDataTable("Select CME, FirstName As FullName From Personnel"), IListSource)).GetList()
Me.cmbPlaceOfWork.DisplayMemberPath = "FullName"
Me.cmbPlaceOfWork.SelectedValuePath = "CME"

End Sub

INFO: DBRelated.GetDataTable("Select CME, FirstName As FullName From Personnel")
The above function is from my class DBRelated and its just returning a datatable (i am using access as my backend db)

03-Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSearch.Click
MessageBox.Show(Me.cmbPlaceOfWork.SelectedValue)
End Sub

Select some value and you can get the SelectedValue by the above property of combobox.

Application/AppDirectory Path WPF

Full exe path
System.Reflection.Assembly.GetExecutingAssembly().Location

Directory from exe file executed
AppDomain.CurrentDomain.BaseDirectory

Tuesday, March 2, 2010

Change label color programmatically in WPF

Rather than System.Drawing.Color enum
use System.Windows.Media.Brushes

Me.lblDentist.Foreground = Brushes.Blue

Exit a WPF application

Application.Current.Shutdown()

Wednesday, February 3, 2010

Change database collation

--script to change database collation - James Agnini
--
--Replace with the database name
--Replace with the collation, eg SQL_Latin1_General_CP1_CI_AS
--
--After running this script, run the script to rebuild all indexes
ALTER DATABASE COLLATE

PlatformNotSupportedException Pocket PC

PlatformNotSupportedException when connecting from Pocket PC to a SQL Server Database.
>> If i try to connect to SQL Server with default collation
>> (i.e. SQL_Latin1_General_CP1_Cl_AS) then SqlClient is working fine and everything is fine.
>> Arif

Wednesday, January 27, 2010