How to Access a Oracle database using Oracle Sql Developer Tool
First you have to check the oracle connection details.
For this purpose use the Oracle Sql Developer Tool.
you can download it from this website.
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
After downloading it to your local machine, unzip it and click on the "sqldeveloper" application to install it.
If Java is not installed on the machine
First you have to install the "supported" java JDK version to your machine.
otherwise it will ask the JDK path to install it.
Provide the Java bin folder path.
ex:
C:\Program Files\Java\jdk1.6.0_21\bin
If Java is already installed in the machine.
Click on the add connection
Then fill these required fields.
Connection Name:any
Username: Correct username
Password: Correct password
hostname: IP address or "localhost"
Port : Default Port "1521" or the Correct Port
SID : Default "xe" OR Service Name : any
Thursday, August 8, 2013
Encrypt or Decrypt Connection Strings in web.config.
Connection strings contain sensative informations like usernames and passwords.So as a good practice we should encrypt those connection strings.
First Methods -> Using "aspnet_regiis.exe" command line tool
1) Go to
Start ---> All Programs --> Microsoft visual studio 2008/2010 --> Visual Studio Tools -->
Visual Studio 2008/2010 Command Prompt(Run as Administrator)
2)Type this command
To Encrypt
aspnet_regiis.exe -pef "connectionStrings" "C:\path_of_web_config_file"
To Decrypt
aspnet_regiis.exe -pdf "connectionStrings" "C:\path_of_web_config_file"
Second Method -> Using Coding
After asp.net 2.0, .net 2.0 provided a protected configuration method to encrypt or decrypt the Connection strings of a web.config file
use this namespaces in the header section of the page.
using System.Configuration;
using System.Web.Configuration;
Add a button to encrypt config file
Put this code inside the click event
Method 1 : RSAProtectedConfigurationProvider
Configuration confg = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection configSect = confg.GetSection(section);
if (configSect != null)
{
configSect.SectionInformation.ProtectSection("RSAProtectedConfigurationProvider");
confg.Save();
}
Method 2: DataProtectionConfgurationProvider
Configuration confg = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection configSect = confg.GetSection(section);
if (configSect != null)
{
configSect.SectionInformation.ProtectSection("DataProtectionConfgurationProvider");
confg.Save();
}
Add a Decrypt button to decrypt a encrypted connection strings
Put this code inside the click event
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection configSect = config.GetSection(section);
if (configSect.SectionInformation.IsProtected)
{
configSect.SectionInformation.UnprotectSection();
config.Save();
}
Connection strings contain sensative informations like usernames and passwords.So as a good practice we should encrypt those connection strings.
First Methods -> Using "aspnet_regiis.exe" command line tool
1) Go to
Start ---> All Programs --> Microsoft visual studio 2008/2010 --> Visual Studio Tools -->
Visual Studio 2008/2010 Command Prompt(Run as Administrator)
2)Type this command
To Encrypt
aspnet_regiis.exe -pef "connectionStrings" "C:\path_of_web_config_file"
To Decrypt
aspnet_regiis.exe -pdf "connectionStrings" "C:\path_of_web_config_file"
Second Method -> Using Coding
After asp.net 2.0, .net 2.0 provided a protected configuration method to encrypt or decrypt the Connection strings of a web.config file
use this namespaces in the header section of the page.
using System.Configuration;
using System.Web.Configuration;
Add a button to encrypt config file
Put this code inside the click event
Method 1 : RSAProtectedConfigurationProvider
Configuration confg = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection configSect = confg.GetSection(section);
if (configSect != null)
{
configSect.SectionInformation.ProtectSection("RSAProtectedConfigurationProvider");
confg.Save();
}
Method 2: DataProtectionConfgurationProvider
Configuration confg = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection configSect = confg.GetSection(section);
if (configSect != null)
{
configSect.SectionInformation.ProtectSection("DataProtectionConfgurationProvider");
confg.Save();
}
Add a Decrypt button to decrypt a encrypted connection strings
Put this code inside the click event
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection configSect = config.GetSection(section);
if (configSect.SectionInformation.IsProtected)
{
configSect.SectionInformation.UnprotectSection();
config.Save();
}
Saturday, August 3, 2013
Useful Visual Studio Shortcuts
General
Ctrl-X or Shift-Delete
Cuts the currently selected item to the clipboard
Ctrl-C or Ctrl-Insert
Copies the currently selected item to the clipboard
Ctrl-V or Shift-Insert
Pastes the item in the clipboard at the cursor
Ctrl-Z or Alt-Backspace
Undo previous editing action
Ctrl-Y or Ctrl-Shift-Z
Redo the previous undo action
Esc
Closes a menu or dialog, cancels an operation in progress, or places focus in the current document window
Ctrl-S
Saves the selected files in the current project (usually the file that is being edited)
Ctrl-Shift-S
Saves all documents and projects
F7
Switches from the design view to the code view in the editor
Shift-F7
Switches from the code view to the design view in the editor
Text navigation
Ctrl-G
Displays the Go to Line dialog.
Ctrl-]
Moves the cursor to the matching brace in the document.
Ctrl-Down Arrow
Scrolls text down one line but does not move the cursor. This is useful for scrolling more text into view without losing your place. Available only in text editors
Ctrl-Up Arrow
Scrolls text up one line but does not move the cursor. Available only in text editors
Ctrl-Right Arrow
Moves the cursor one word to the right
Ctrl-Left Arrow
Moves the cursor one word to the left
Text manipulation
Ctrl-K, Ctrl-C
Marks the current line or selected lines of code as a comment, using the correct comment syntax for the programming language
Ctrl-K, Ctrl-U
Removes the comment syntax from the current line or currently selected lines of code
Ctrl-U
Changes the selected text to lowercase characters
Ctrl-Shift-U
Changes the selected text to uppercase characters
Ctrl-Shift-Spacebar
Displays a tooltip that contains information for the current parameter, based on the current language
Project related
Ctrl-Shift-B
Builds the solution
Ctrl-N
Displays the New File dialog.
Ctrl-Shift-N
Displays the New Project dialog
Ctrl-O
Displays the Open File dialog
Ctrl-Shift-O
Displays the Open Project dialog
Shift-Alt-A
Displays the Add Existing Item dialog
Ctrl-Shift-A
Displays the Add New Item dialog
Search and replace
Ctrl-F
Displays the Find dialog
Ctrl-Shift-F
Displays the Find in Files dialog
Ctrl-I
Starts an incremental search
Ctrl-H
Displays the Replace dialog
Ctrl-Shift-H
Displays the Replace in Files dialog
Debugging
Ctrl-F10
Starts or resumes execution of your code and then halts execution when it reaches the selected statement.
Ctrl-Shift-F10
Sets the execution point to the line of code you choose
Ctrl-Shift-F5
Terminates the current debugging session, rebuilds if necessary, and then starts a new debugging session. Available in break and run modes
F11
Executes code one statement at a time, tracing execution into function calls
Shift-F11
Executes the remaining lines of a function in which the current execution point lies
F10
Executes the next line of code but does not step into any function calls
Shift-F5
Available in break and run modes, this terminates the debugging session
F9
Sets or removes a breakpoint at the current line
Tool window
F4
Displays the Properties window
Ctrl-Shift-E
Displays the Resource View window
Ctrl-Alt-S
Displays the Server Explorer window
Ctrl-Alt-L
Displays the Solution Explorer
Ctrl-Alt-K
Displays the TaskList window, which displays tasks, comments, shortcuts, warnings, and error messages
Link : http://www.codeproject.com/Tips/102936/Visual-Studio-Shortcuts
General
Ctrl-X or Shift-Delete
Cuts the currently selected item to the clipboard
Ctrl-C or Ctrl-Insert
Copies the currently selected item to the clipboard
Ctrl-V or Shift-Insert
Pastes the item in the clipboard at the cursor
Ctrl-Z or Alt-Backspace
Undo previous editing action
Ctrl-Y or Ctrl-Shift-Z
Redo the previous undo action
Esc
Closes a menu or dialog, cancels an operation in progress, or places focus in the current document window
Ctrl-S
Saves the selected files in the current project (usually the file that is being edited)
Ctrl-Shift-S
Saves all documents and projects
F7
Switches from the design view to the code view in the editor
Shift-F7
Switches from the code view to the design view in the editor
Text navigation
Ctrl-G
Displays the Go to Line dialog.
Ctrl-]
Moves the cursor to the matching brace in the document.
Ctrl-Down Arrow
Scrolls text down one line but does not move the cursor. This is useful for scrolling more text into view without losing your place. Available only in text editors
Ctrl-Up Arrow
Scrolls text up one line but does not move the cursor. Available only in text editors
Ctrl-Right Arrow
Moves the cursor one word to the right
Ctrl-Left Arrow
Moves the cursor one word to the left
Text manipulation
Ctrl-K, Ctrl-C
Marks the current line or selected lines of code as a comment, using the correct comment syntax for the programming language
Ctrl-K, Ctrl-U
Removes the comment syntax from the current line or currently selected lines of code
Ctrl-U
Changes the selected text to lowercase characters
Ctrl-Shift-U
Changes the selected text to uppercase characters
Ctrl-Shift-Spacebar
Displays a tooltip that contains information for the current parameter, based on the current language
Project related
Ctrl-Shift-B
Builds the solution
Ctrl-N
Displays the New File dialog.
Ctrl-Shift-N
Displays the New Project dialog
Ctrl-O
Displays the Open File dialog
Ctrl-Shift-O
Displays the Open Project dialog
Shift-Alt-A
Displays the Add Existing Item dialog
Ctrl-Shift-A
Displays the Add New Item dialog
Search and replace
Ctrl-F
Displays the Find dialog
Ctrl-Shift-F
Displays the Find in Files dialog
Ctrl-I
Starts an incremental search
Ctrl-H
Displays the Replace dialog
Ctrl-Shift-H
Displays the Replace in Files dialog
Debugging
Ctrl-F10
Starts or resumes execution of your code and then halts execution when it reaches the selected statement.
Ctrl-Shift-F10
Sets the execution point to the line of code you choose
Ctrl-Shift-F5
Terminates the current debugging session, rebuilds if necessary, and then starts a new debugging session. Available in break and run modes
F11
Executes code one statement at a time, tracing execution into function calls
Shift-F11
Executes the remaining lines of a function in which the current execution point lies
F10
Executes the next line of code but does not step into any function calls
Shift-F5
Available in break and run modes, this terminates the debugging session
F9
Sets or removes a breakpoint at the current line
Tool window
F4
Displays the Properties window
Ctrl-Shift-E
Displays the Resource View window
Ctrl-Alt-S
Displays the Server Explorer window
Ctrl-Alt-L
Displays the Solution Explorer
Ctrl-Alt-K
Displays the TaskList window, which displays tasks, comments, shortcuts, warnings, and error messages
Link : http://www.codeproject.com/Tips/102936/Visual-Studio-Shortcuts
Useful Stuff about Grid-views
1.How to manipulate a Grid-view cell in ASP.NET
foreach(DataGridViewRow row in this.Gvorders.Rows)
{
if (row.HeaderCell.Value == txtorder.Text)
{
for (int i = 0; i < Gvorders.Columns.Count; i++)
{
this.Gvorders.CurrentCell = row.Cells[i];
row.Cells[i].Style.BackColor = Color.Green;
}
}
}
Link: http://www.codeproject.com/Tips/387941/How-to-manipulate-a-GridView-cell-in-ASP-NET
2.Using the j Query Tool-tip Plugin in a Grid-view
<asp:TemplateField HeaderText="Category ID" SortExpression="CategoryID" HeaderStyle-Wrap="false">
<ItemStyle Width="30px" HorizontalAlign="Center" />
<ItemTemplate>
<div class="tag">
<a href="#" class="gridViewToolTip"><%# Eval("CategoryID")%>
</a>
<div id="tooltip" style="display: none;">
<table>
<tr>
<td style="white-space: nowrap;"><b>Category ID:</b> </td>
<td><%# Eval("Categories.Value.CategoryID")%></td>
</tr>
<tr>
<td style="white-space: nowrap;"><b>Category Name:</b> </td>
<td><%# Eval("Categories.Value.CategoryName")%></td>
</tr>
<tr>
<td style="white-space: nowrap;"><b>Description:</b> </td>
<td><%# Eval("Categories.Value.Description")%></td>
</tr>
</table>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
Link: http://www.codeproject.com/Articles/238678/Using-The-JQuery-Tooltip-Plugin-in-a-GridView
3.How to click/select Row in ASP.NET Grid-view or HTML Table
protected void grvGroups_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "setGridValue('" + e.Row.ClientID + "')");
}
}
Link:http://www.codeproject.com/Tips/308334/How-to-click-select-Row-in-ASP-NET-GridView-or-HTM
4.Add some Style to your Grid-view
<asp:GridView ID="lostGridView" runat="server" PageSize="5" CellPadding="4" BackColor="#E98A28"
BorderColor="#DEBA84" GridLines="Both" Width="900px" BorderWidth ="1px" CssClass="pager">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#F9A044" Font-Bold="True" ForeColor="#8C4510" />
<HeaderStyle BackColor="#EB9429" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F9A044" CssClass="hidden" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<style type="text/css">
.pager span
{
text-decoration:underline;
font-weight: bold;
font-size: 10pt;
}
</style>
<asp:GridView ID="lostGridView" runat="server" PageSize="5" CellPadding="4" BackColor="#E98A28"
BorderColor="#DEBA84" GridLines="Both" Width="900px" BorderWidth ="1px" CssClass="pager" />
6. Grid-view all in one
What is a GridView?
GridView Fields
1.BoundColumn
2.HyperLinkColumn
3.TemplateColumn
4.CommandField
5.Different Types of Events
6.PageIndexChanging
7.Paging
8.RowCommand
9.RowCreated
10.RowDeleting
11.RowUpdating
12.RowEditing
13.RowDatabound
14.Sorting
15.Header and Footer of the Grid
16.Export GridView to Word, Excel, and PDF
17.Difference between DataGrid, DataList, and Repeater
Link: http://www.codeproject.com/Articles/36528/GridView-all-in-one
7.Implement Paging in a Grid-view
<asp:GridView ID="resultsGridView" runat="server" PageSize="5" AllowPaging="True"
CellPadding="4" BackColor="#E98A28" BorderColor="#DEBA84" GridLines="Both" Width="900px" BorderWidth ="1px" CssClass="pager"
OnPageIndexChanging="resultsGridView_SelectedIndexChanging">
Subscribe to:
Posts (Atom)