Wednesday, November 9, 2011

Asp.Net Membership and Role Provider

Introduction

Asp.Net 2.0 provides built in controls to manage Membership in Web Applications. All these controls use Asp.Net providers that are loaded via web.config file. Membership provider and Role provider allows a complete system to maintain users information, authenticate and authorize the users. This article demonstrates how to use and configure the default Member ship and Role provider.

JavaScript for Asp.Net Developers

Introduction

JavaScript along with Asp.net helps u to build web applications which are robust and effective. In this article the most commonly used tasks which can be achieved in Asp.net by using JavaScript are discussed. The article describes the following content. JavaScript to perform validations, JavaScript client side API for Asp.net Server Controls, Call a JavaScript from code behind and Vice-Versa, Grid View alert for deleting, Pass the C# variables to JavaScript array, Pop-up in Grid View.

JavaScript Create User Wizard for Asp.Net

Introduction

Asp.net provides built in create user wizard for membership which can be customized automatically depending on the user requirements. But in some cases if you want your own custom create user wizard and then this articles explains you the way to achieve your requirement. The Designed control provides you the flexible way to implement the membership wizard for the user.

Background

Sunday, September 25, 2011

Welcome to My Blog

Welcome.
Welcome To Technowallet. This blog is a beginners guide to develop web applications using .Net Technologies.
All the articles helps u to quickly learn the related technologies. 

Thursday, September 15, 2011

GridView

GridView:
Displays the values of a data source in a table where each column represents a field and each row represents a record. The GridView control allows you to select, sort, and edit these items.
Working with GridView DataSource controls to display data:
GridView can be bind with any one of the following DataSource controls:
SqlDataSource
LinqDataSource
ObjectDataSource
XmlDataSource.
Without need to write any line of code directly one can directly bind the DataSource Controls to display the data in GridView. In the below examples we will work with SqlDataSource and ObjectDataSource controls.
1.       SqlDataSource:
2.      ObjectDataSource:
In general the ObjectDataSource control is used to bind the data from the business logic class. So, first we will take a look at how to create a class that can bind data to GridView.
Creating your Movie class:
Follow the steps to create the Movie Class:
1. Open visual studio, create a new Empty Web Site and save it in u r local directory with some name.
.
2.      Go to solution explorer add a new master page and then add a new content page.

Monday, September 12, 2011

Sql Command

Sql Command:

Sql Command is a connected class of Ado.Net Object model. Sql Command Class is used to perform various database operations over a given connection object (Sql server Database). Sql Command Class is used to perform both synchronous and asynchronous operations. The available methods and properties of Command Object allow you to execute a Sql query or stored procedure.

Saturday, September 10, 2011

Stored Procedure

Stored Procedure:

Stored Procedures are precompiled Sql server objects which store the Sql queries and executes whenever the stored procedure is called. In this tutorial we will see how to work with stored procedure. The following things are discussed in this article.
  1. Create and Execute Stored Procedure.
  2. Stored Procedure with parameter.
  3. Stored Procedure with output parameter.
  4. Return a value from stored procedure.
  5. Call a Stored Procedure from another Stored Procedure

Friday, September 9, 2011

Sql Data Reader

Sql Data Reader:

Data Reader object allows you to perform forward only read only operations over the database. Data Reader is another connected class of Ado.net and is one of the two available data storages objects of Ado.net object model.

Saturday, August 6, 2011

sql Dat Adapter


  1. Sql data Adapter:

Insert/update/Delete Records:

1.      Establish the connection to the sql server by using sql connection class.
        SqlConnection cnn = new SqlConnection("Data Source = .\\SQLEXPRESS; Initial Catalog = master;Integrated Security= true");

2.      Open the connection
3.      Execute the sql query to insert/update/delete the record(s) by using sql data adapter.
            SqlDataAdapter da = new SqlDataAdapter(new SqlCommand("Insert into student values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')",cnn));
4.      Use one of the following combinations of properties and methods as per the requirements.
·        InsertCommand.ExecuteNonQuery();
·        UpdateCommand.ExecuteNonQuery();
·        DeleteCommand.ExecuteNonQuery();
·        SelectCommand.ExecuteNonQuery();

da.InsertCommand.ExecuteNonQuery();
            cnn.Close();

Alternately u can use SelectCommand.ExecuteNonQuery(); to perform insert/delete/update operations as shown below.
cnn.Open();
            SqlDataAdapter da = new SqlDataAdapter("Insert into student values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "'",cnn);
            da.SelectCommand.ExecuteNonQuery();
            cnn.Close();

5.      Finally close the connection.

Binding Source

Binding Source:

Retrieving Information from database by using Binding Source:
  1. Establish the connection to the sql server by using sql connection class.
  2. SqlConnection cnn = new SqlConnection("Data Source = abc;
    Initial Catalog = master;Integrated Security= true");
  3. Execute the sql query to retrieve information by using sql data adapter.
  4. SqlDataAdapter da = new SqlDataAdapter("select * from student", cnn);
  5. Fill the values in Data Set by using the sql data adapter.
  6. da.Fill(ds, "student");
  7. Bind the dataset as data source to the binding source.
  8. bs.DataSource = ds.Tables["student"];
  9. Bind the values to the controls.
  10. textBox1.DataBindings.Add("Text", bs, "studnetid");
  11. Repeat the syntax for all the controls. Use the binding source methods to navigate between the values.
  12. bs.MoveFirst();bs.MovePrevious();bs.MoveNext();bs.MoveLast();