Menu Links

Wednesday, May 18, 2016

JavaScript - this

this Object

"this" object mean in object oriented language - refer to the current object.

But when we think in JavaScript language it's bit different as JavaScript is a functional oriented language not object oriented.

When ever we create a function in JavaScript, it mapped your all variables and inner function objects either in local or global memory area based on the scope of variables and inner functions. 

Every function Inside local memory heap create one more additional object called "this". it refer to window  object.

e.g.      function blogs()
            {

                 var x = 10;    // local variable
                 y = 20;     //global variable

                  var obj = function(){}// inner anonymous function

             } 

What is the understanding of above example.. ? How this function variable and functions are mapped to browser memory? What are the wrong statement written for the performance prospect? Where is my "this" object?

Tuesday, May 17, 2016

JavaScript -

Whenever we talk about JavaScript, we think it use for validation and some extend to manipulate DOM. Am i  correct?

Other than that now day's JavaScript is very popular and demanded in market to giving the preference on client centric applications. Because now industry looking the application not only be full of features or functionality also wants to develop application processing very first on browser and also wants to process almost all the business login in client side means browser instead of execute in server side  , So industry adopting different library or framework like JQuey.js , Node.js , Cofee Script , Angualr.JS and Backbone.JS.

All these library and framework build up on top of JavaScript.So million dollar of question here like how much we are comfortable in JavaScript ? Do we know how my Java Script interpreter in browser? When we write a function in Java Script what exactly happened? How browser handle my function?   all these questions , how related to library and framework?

On my coming post i will explain you all these questions step by step..follow me..

Tuesday, August 23, 2011

Get the table data in the csv format file

select top 10 'exec master..xp_cmdshell'+ ' '''+ 'bcp'
+ ' ' + TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME + ' out'+ ' c:\Temp\'
+ TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME + '.csv' + ' -c -t; -T -S' + @@servername+ ''''from INFORMATION_SCHEMA.TABLESwhere TABLE_TYPE = 'BASE TABLE'

How to store HTML code in database in ASP.NET application?

// For encode the data into the data base
// Server.Encode() will help to convert entire HTML to encoded format.

protected void btnSubmit_Click(object sender, EventArgs e)
    {
int status = objBL.SaveContent(Server.HtmlEncode(wftxtContent.Text),wddlPageName.SelectedValue.ToString());
    }

public int SaveContent(string content,string pageid)
        {

Query = "UPDATE [PageContent] SET PageContent = '" + content + "' WHERE [ID] = " + pageid;

            Database objDB = DatabaseFactory.CreateDatabase();
           
            int chkInsert = objDB.ExecuteNonQuery(CommandType.Text, Query);
           
            return chkInsert;

        }
// For decode the data from data base
// Server.Encode() will help to convert entire HTML to encoded format.


wftxtContent.Text = Server.HtmlDecode(objBL.getContent());

public string getContent(string pageid)
        {
           
Query = "SELECT PageContent FROM [PageContent] WHERE [ID] = " + pageid;

            Database objDB = DatabaseFactory.CreateDatabase();
string Content = objDB.ExecuteScalar(CommandType.Text, Query).ToString();

            return Content;

        }

Monday, August 22, 2011

What is SQL Server Import / Export wizard for SSIS?

It helps to DBA and developer to data movement from a source to any targeted source.
Steps to run a wizard in SQL Server
1.       Select a database in Microsoft SQL Server Management Studio.
2.       Right click on database, Go to Tasks and select Import / Export wizard.
3.        New window will appear

4.       Click Next; it will take to another page for the source selection


















5.       Select the data source; by default it is SQL Native client if your source is different your can chose data source as access, excel, txt file or any other database provider.
6.       If you have selected the data source SQL Native client then need to provide the server and credential details and chose database from where your want to transfer data.

7.       If you have selected any other data source like access, excel or txt file then browser the file from the physical path. And here you need to follow some more steps I will explain in my next post.
8.       Click next; It will take to another page for the destination selection. This section is as same as the data source.
9.       Click next ; It will take to summary page
10.   Click finish