The RadioButton Control
1.The RadioButton control gives the user the ability to select between mutually exclusive RadioButton controls in a group. To group multiple RadioButton controls together, specify the same GroupName for each RadioButton control. Grouping radio buttons together only allows a mutually exclusive selection from the group.
Security Alert Populating the RadioButton control’s Text property with data from an untrusted source can create Cross Site Scripting (XSS) vulnerabilities. Use the HttpUtility.HtmlEncode or Server.HtmlEncode method to encode the untrusted data that is placed in the Text property.
2.The RadioButton control’s Text property specifies its caption. Use the TextAlign property
to specify the side that the caption appears on. The Checked property is used to set and get the status of the RadioButton control.
Wednesday, August 27, 2008
The CheckBox Control[Common Web Server Controls]
The CheckBox Control
1.The CheckBox control gives the user the ability to select between true and false. The CheckBox control’s Text property specifies its caption. Use the TextAlign property to specify on which side that the caption appears. The Checked property is used to set and get the status of the CheckBox control.
Security Alert Populating the CheckBox control’s Text property with data from an untrusted source can create Cross Site Scripting (XSS) vulnerabilities. Use the HttpUtility.HtmlEncode or Server.HtmlEncode method to encode the untrusted data that is placed in the Text property.
2.The CheckedChanged event is raised when the state of the CheckBox control changes, but by default, the AutoPostBack property of the CheckBox control is set to false. This means that changing the checked state does not cause a PostBack, but the Check-Changed event is raised when another control performs a PostBack.
1.The CheckBox control gives the user the ability to select between true and false. The CheckBox control’s Text property specifies its caption. Use the TextAlign property to specify on which side that the caption appears. The Checked property is used to set and get the status of the CheckBox control.
Security Alert Populating the CheckBox control’s Text property with data from an untrusted source can create Cross Site Scripting (XSS) vulnerabilities. Use the HttpUtility.HtmlEncode or Server.HtmlEncode method to encode the untrusted data that is placed in the Text property.
2.The CheckedChanged event is raised when the state of the CheckBox control changes, but by default, the AutoPostBack property of the CheckBox control is set to false. This means that changing the checked state does not cause a PostBack, but the Check-Changed event is raised when another control performs a PostBack.
The Button Control[Common Web Server Controls]
The Button Control
1.The Button control displays a push button on the Web page that the user can click to trigger a PostBack to the Web server. A Button can be either a submit (default) button or a command button.
A submit button does not have its CommandName property set and simply performs a PostBack to the server. You provide an event handler for the Click event to control the actions performed when the user clicks the submit button.
You can use a Button as a command button by assigning a command name, such as ChangeChannel or FastFoward, to the CommandName property. Using the Command-Name property allows you to create multiple Button controls on a Web page; you can programmatically determine which button is clicked in the event handler for the Command
event. You can also use the CommandArgument property to provide additional information about the command to perform, such as ChannelUp, ChannelDown, x2 (FastForward x 2), or x3 (FastForward x 3). Simply provide an event handler for the Command event to control the actions performed when a command button is clicked.
2.The Button control also contains a CausesValidation property that is set to true by default, which causes page validation to be performed when a Button control is clicked. Set the CausesValidation property to false when you want a button to bypass validation. Reset and help buttons are examples of buttons that typically bypass validation.
1.The Button control displays a push button on the Web page that the user can click to trigger a PostBack to the Web server. A Button can be either a submit (default) button or a command button.
A submit button does not have its CommandName property set and simply performs a PostBack to the server. You provide an event handler for the Click event to control the actions performed when the user clicks the submit button.
You can use a Button as a command button by assigning a command name, such as ChangeChannel or FastFoward, to the CommandName property. Using the Command-Name property allows you to create multiple Button controls on a Web page; you can programmatically determine which button is clicked in the event handler for the Command
event. You can also use the CommandArgument property to provide additional information about the command to perform, such as ChannelUp, ChannelDown, x2 (FastForward x 2), or x3 (FastForward x 3). Simply provide an event handler for the Command event to control the actions performed when a command button is clicked.
2.The Button control also contains a CausesValidation property that is set to true by default, which causes page validation to be performed when a Button control is clicked. Set the CausesValidation property to false when you want a button to bypass validation. Reset and help buttons are examples of buttons that typically bypass validation.
The TextBox Control [Common Web Server Controls]
The TextBox Control
1.The TextBox control collects text from the user. The Text property gets or sets the contents of the TextBox control.
2.The TextBox contains a TextMode property that you can set to SingleLine (default), MultiLine, or Password. SingleLine allows the user to enter a single line of text, Multi-Line allows the user to enter many lines of text, and Password creates a single-line text box that masks the value entered by the user.
3.The Columns property sets the maximum width of the TextBox; the Rows property sets the maximum height of a multiline TextBox.
4.The MaxLength property limits the number of characters that can be entered; the Wrap property automatically continues the text on the next line when the end of the text box is reached.
1.The TextBox control collects text from the user. The Text property gets or sets the contents of the TextBox control.
2.The TextBox contains a TextMode property that you can set to SingleLine (default), MultiLine, or Password. SingleLine allows the user to enter a single line of text, Multi-Line allows the user to enter many lines of text, and Password creates a single-line text box that masks the value entered by the user.
3.The Columns property sets the maximum width of the TextBox; the Rows property sets the maximum height of a multiline TextBox.
4.The MaxLength property limits the number of characters that can be entered; the Wrap property automatically continues the text on the next line when the end of the text box is reached.
The Label Control[Common Web Server Controls]
The Label Control
1.The Label control displays text at a specific location on the Web page using the properties
that the control has been assigned. Use the Label control when server code changes the text or the properties. If you only need to display static text, use HTML or the Literal control instead of using a Label control. The Literal control also displays text and the text can be changed by server code, but the Literal control does not support
styles, themes, and skins.
2.Labels can be used as the caption of the TextBox or other controls in a situation where using the access key for the Label moves the focus to the control to the right of the Label.
1.The Label control displays text at a specific location on the Web page using the properties
that the control has been assigned. Use the Label control when server code changes the text or the properties. If you only need to display static text, use HTML or the Literal control instead of using a Label control. The Literal control also displays text and the text can be changed by server code, but the Literal control does not support
styles, themes, and skins.
2.Labels can be used as the caption of the TextBox or other controls in a situation where using the access key for the Label moves the focus to the control to the right of the Label.
Sunday, May 18, 2008
How to setup AJAX Tool kit in Visual Studio 2005
Setup your environment
Install binaries
- Install the latest ASP.NET AJAX Extensions 1.0 package
- Unpack the AJAX Control Toolkit into a folder on your computer
Configure Visual Studio 2005 and Visual Web Developer
- Create a new web site from the ASP.NET AJAX web site template by opening the "File" menu, clicking "New", "Web Site...", and picking "ASP.NET AJAX Web Site" under "My Templates"
- Right-click on the Toolbox and select "Add Tab", and add a tab called "AJAX Control Toolkit"
- Inside that tab, right-click on the Toolbox and select "Choose Items..."
- When the "Choose Toolbox Items" dialog appears, click the "Browse..." button. Navigate to the folder where you installed the ASP.NET AJAX Control Toolkit package. You will find a folder called "SampleWebSite", and under that another folder called "bin". Inside that folder, select "AjaxControlToolkit.dll" and click OK. Click OK again to close the Choose Items Dialog.
- You can now use the included sample controls in your web sites!
Installing AJAX Control Toolkit Templates
- In the folder where you installed the AJAX Control Toolkit package, you will find a folder called "AjaxControlExtender" with a file called "AjaxControlExtender.vsi" inside it - double-click AjaxControlExtender.vsi to install it
- Choose which templates you would like to install, then click "Next", then "Yes" to allow the unsigned content (note: as a public project, this content can't be signed by Microsoft), then "Finish"
- You have now installed the templates are ready to create your own Toolkit-based web site or ASP.NET AJAX Extenders!
The TemplateVSI project has a dependency on vjslib.dll which is a part of the Visual J# Redistributable Package. If you would like to build that project successfully then please install the package from here.
Upgrading to a newer Toolkit release
If you were using an older release of the Toolkit and now need to move to a later version here are the recommended steps:
- Binaries: Overwrite all old instances of the Toolkit binary "AjaxControlToolkit.dll" on your machine with the new one.
- Toolbox items: Delete the old tab that listed Toolkit controls and recreate it using the new Toolkit DLL.
- Toolkit templates: Reinstall the new "AjaxControlExtender.vsi" and check to overwrite the old templates in the "Add Templates" wizard.
Note: This article collect from Microsoft web-development part.
Tuesday, December 25, 2007
Connection with Oracle and VB.NET
Connection with Oracle and VB.NET
In this section i show how connect with oracle and VB.NET
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---1---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
At first Design a form with .NET.
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---2---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
Add Module from new add Items .Then new module will be added .
Write main connection sting in this module
Example code:
Imports System.Data.OleDb 'Working with oledb data access
Module Module1
Public orada As OleDbDataAdapter 'Represents a set of data commands and a database connection that are
' ''used to fill the DataSet and update the data source.
Public orads As DataSet
Public oradrSQL As OleDbDataReader 'is used to read rows from source
Public oracnSQL As OleDbConnection 'Represent a unique connection to a database
Public oracmSQL As OleDbCommand 'Present a SQL statement to execute against a data source
Public orastrSQL As String
Public oraconnectionString As String = _
"Provider=msdaora;Data Source=dboracle;Persist Security Info=True;User ID=scott;Password=tiger;Unicode=True"
Public Sub mainConnection()
oracnSQL = New OleDbConnection(oraconnectionString)
oracnSQL.Open()
End Sub
Public Sub load_grid()
orada = New OleDbDataAdapter("Select * from table_info", oraconnectionString)
orads = New DataSet
orada.Fill(orads) 'Fill keeps data into dataset
FrmInfo.DataGridView1.DataSource = orads.Tables(0)
End Sub
End Module
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---3---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
Now this connection call from form
So that all SQL statement will executed like Save,Delete,Update,Search,Exit
Note: Connection must be call in Load event
Example code :
Imports System.Data.OleDb
Imports Microsoft.VisualBasic
Public Class FrmInfo
Private Sub frmSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmSave.Click
orastrSQL = "insert into table_info values('" & _
TextBox1.Text & "', '" & _
TextBox2.Text & "', '" & _
TextBox3.Text & "', '" & _
TextBox4.Text & "', '" & _
TextBox5.Text & "', '" & _
TextBox6.Text & "', '" & _
TextBox7.Text & "')"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oracmSQL.ExecuteNonQuery() 'perform insert,update or delete operations
MessageBox.Show("Saved Successfully")
load_grid()
End Sub
Private Sub FrmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mainConnection()
load_grid()
End Sub
Private Sub frmSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmSearch.Click
orastrSQL = "Select * from table_info WHERE (Name='" & Me.TextBox1.Text & "')"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oradrSQL = oracmSQL.ExecuteReader()
If oradrSQL.Read() Then
TextBox1.Text = oradrSQL.Item(0).ToString
TextBox2.Text = oradrSQL.Item(1).ToString
TextBox3.Text = oradrSQL.Item(2).ToString
TextBox4.Text = oradrSQL.Item(3).ToString
TextBox5.Text = oradrSQL.Item(4).ToString
TextBox6.Text = oradrSQL.Item(5).ToString
TextBox7.Text = oradrSQL.Item(6).ToString
Else
MessageBox.Show("Data Not Found", "Serach", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
Private Sub frmExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmExit.Click
Me.Close()
End Sub
Private Sub frmDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmDelete.Click
orastrSQL = "Delete from table_info where Name='" & TextBox1.Text & "'"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oracmSQL.ExecuteNonQuery()
MessageBox.Show("Deleted Successfully")
load_grid()
End Sub
Private Sub frmUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmUpdate.Click
orastrSQL = "Update table_info set Age ='" & TextBox2.Text & "',Sex ='" & TextBox3.Text & " ', " _
& "Address ='" & TextBox4.Text & "'," & "Phone ='" & TextBox5.Text & "'," _
& "Email ='" & TextBox6.Text & "'," & "Nationality ='" & TextBox7.Text & "' where Name ='" & TextBox1.Text & "'"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oracmSQL.ExecuteNonQuery()
MessageBox.Show("Updates Successfully")
load_grid()
End Sub
End Class
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---4---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
All SQL statement are declare above portion.
so lets try.
You can see DEMO from this link SAMPLE DEMO
_________________________________________________________________
Note: This Example is for applicable only desktop applications
_________________________________________________________________
In this section i show how connect with oracle and VB.NET
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---1---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
At first Design a form with .NET.
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---2---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
Add Module from new add Items .Then new module will be added .
Write main connection sting in this module
Example code:
Imports System.Data.OleDb 'Working with oledb data access
Module Module1
Public orada As OleDbDataAdapter 'Represents a set of data commands and a database connection that are
' ''used to fill the DataSet and update the data source.
Public orads As DataSet
Public oradrSQL As OleDbDataReader 'is used to read rows from source
Public oracnSQL As OleDbConnection 'Represent a unique connection to a database
Public oracmSQL As OleDbCommand 'Present a SQL statement to execute against a data source
Public orastrSQL As String
Public oraconnectionString As String = _
"Provider=msdaora;Data Source=dboracle;Persist Security Info=True;User ID=scott;Password=tiger;Unicode=True"
Public Sub mainConnection()
oracnSQL = New OleDbConnection(oraconnectionString)
oracnSQL.Open()
End Sub
Public Sub load_grid()
orada = New OleDbDataAdapter("Select * from table_info", oraconnectionString)
orads = New DataSet
orada.Fill(orads) 'Fill keeps data into dataset
FrmInfo.DataGridView1.DataSource = orads.Tables(0)
End Sub
End Module
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---3---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
Now this connection call from form
So that all SQL statement will executed like Save,Delete,Update,Search,Exit
Note: Connection must be call in Load event
Example code :
Imports System.Data.OleDb
Imports Microsoft.VisualBasic
Public Class FrmInfo
Private Sub frmSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmSave.Click
orastrSQL = "insert into table_info values('" & _
TextBox1.Text & "', '" & _
TextBox2.Text & "', '" & _
TextBox3.Text & "', '" & _
TextBox4.Text & "', '" & _
TextBox5.Text & "', '" & _
TextBox6.Text & "', '" & _
TextBox7.Text & "')"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oracmSQL.ExecuteNonQuery() 'perform insert,update or delete operations
MessageBox.Show("Saved Successfully")
load_grid()
End Sub
Private Sub FrmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mainConnection()
load_grid()
End Sub
Private Sub frmSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmSearch.Click
orastrSQL = "Select * from table_info WHERE (Name='" & Me.TextBox1.Text & "')"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oradrSQL = oracmSQL.ExecuteReader()
If oradrSQL.Read() Then
TextBox1.Text = oradrSQL.Item(0).ToString
TextBox2.Text = oradrSQL.Item(1).ToString
TextBox3.Text = oradrSQL.Item(2).ToString
TextBox4.Text = oradrSQL.Item(3).ToString
TextBox5.Text = oradrSQL.Item(4).ToString
TextBox6.Text = oradrSQL.Item(5).ToString
TextBox7.Text = oradrSQL.Item(6).ToString
Else
MessageBox.Show("Data Not Found", "Serach", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
Private Sub frmExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmExit.Click
Me.Close()
End Sub
Private Sub frmDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmDelete.Click
orastrSQL = "Delete from table_info where Name='" & TextBox1.Text & "'"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oracmSQL.ExecuteNonQuery()
MessageBox.Show("Deleted Successfully")
load_grid()
End Sub
Private Sub frmUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles frmUpdate.Click
orastrSQL = "Update table_info set Age ='" & TextBox2.Text & "',Sex ='" & TextBox3.Text & " ', " _
& "Address ='" & TextBox4.Text & "'," & "Phone ='" & TextBox5.Text & "'," _
& "Email ='" & TextBox6.Text & "'," & "Nationality ='" & TextBox7.Text & "' where Name ='" & TextBox1.Text & "'"
oracmSQL = New OleDbCommand(orastrSQL, oracnSQL)
oracmSQL.ExecuteNonQuery()
MessageBox.Show("Updates Successfully")
load_grid()
End Sub
End Class
--------------------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!---4---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------------------------------------------
All SQL statement are declare above portion.
so lets try.
You can see DEMO from this link SAMPLE DEMO
_________________________________________________________________
Note: This Example is for applicable only desktop applications
_________________________________________________________________
Subscribe to:
Posts (Atom)


