Posts

Showing posts from September, 2012

Adding AutoComplete Functionality to a TextBox Control using C#.Net

Image
Hello Friends !! Today I am writing my first C#.Net Article going a bit out of my way from SQL and MSBI. This is something related to a requirement which comes my way when in a windows Application i need to give a drop down for all like customer names when typing the names in the Text Box as a very basic user friendly option. Here is how we can do this - Let's take as assumption as we have a table in SQL as CustomerTable and we want to take the FirstName of the Customer as our search result. we will write this code in the Form load event of the form which contains the Text box. The connectionStringName will be configured and can be get from the App.Config table. Also you need to change the below 2 properties of the Text Box on which you want to implement the Auto Complete functionality. SqlConnection  con = new  SqlConnection ( ConfigurationManager .ConnectionStrings[ "connectionStringName" ].ConnectionString); SqlCommand  cmd =  new   Sq

Pump data from one server to another Efficiently

Image
Sometimes the requirement comes when we need to pump the data from one server to another server. Though we have SQL Import\Export wizard which can do this quiet easily, but in that way we will loose some important features of the table --      1. The Identity property of a column in case we have one in the table.      2. All the indexes. To avoid this we can go with a simple SSIS package to which we just need to pass the table name as a parameter and it will do the rest, taking care of the above constraints. This is how the Package looks - Steps - 1. To make the executable dynamic we will drive the package from a table, where we will    store the names of all the tables which we want to refresh from the source server and we will store it in a result set variable (Table_List) Refer the variables list in the below figure used in the package. 2. Create a For each loop container which will iterate throu