Wednesday, August 15, 2007

Mobile emulators in Visual Studio

This is how you can configure mobile device emulators in visual studio 2005.

1. install Microsoft "virtual pc" and "active sync"
2. open active sync and change dropdown to "DMA" and press ok
3. open device manager from .net IDE>> tools>> device emulator manager
4. right click the one you need to connect
5. select "connect". this will open the device interface
6. now right click the same item from the device manager
7. select "craddle". this will connnet your PC to the device.

now use the browser of the device to connect to your PC IIS. you need to use the MACHINE NAME as the sever name. (IP or LOCALHOST wont work) This can be used to develop and test windows and web applications for mobile devices.

Wednesday, August 1, 2007

Sql Server - BCP (Bulk copy program)

Bulk copy program is a very useful tool to be used when populating bulk data to the DB when load testing though it is not the intended usage of it. It created to set transfer bulk copies from server to any other in case of a batch transfer.

The simple command template is:
bcp <Db name>.dbo.<table name> in <file name> -c -t, -S<db server name> -U<user name> -P<password>

Exsample:
bcp MyDB.dbo.User out c:\users.txt -c -t, -S192.168.100.01 -Ume -Ptest

When you use "out", it will output table data to the specified file. By simply changing "out" to "in", you can easily input data from a text file you already have.

The above is for using sql server authentication to login to the server. If you need to use windows authentication, you need to add "-T" switch also. There are lot of other switches you can use with this command.