Titbits of Sql Server Db Mirroring Using Asp.Net
Your Web Or Windows Apps required many sorts of protections for maltreatments of Data in Database.
For that SQL Server provides you multiple ways to recover your data from loss or tampering. In a recent project my Apps are required to communicate with both Databases that are hosted in a Web Server and a Local Server. This really hampers the speed of the execution. At that time I need to implement a system that will connect the Web DB first then the Local DB if the first attempt fails.
So, browsing the Internet I came to know about Database mirroring. This is actually a technology that ships the data from one server to another.
What I did first was to assume my Web Database Server the primary one (let’s say Server A) and assume the local one as Server B.
Now for the coding part the simple task is to define the connectionstring i.e.
Data Source=Server A; Failover Partner=Server B; Initial Catalog=testDB; Integrated Security=True;
But the database configuration is bit complicated. The requirements are given below:
Server A is in full recovery mode
Server B is created with the full backup of Server A.
Server B is restored in “Restore with Norecovery” model to ensure the synchronous log sequences of both Database Servers.
Both Db in Server A and Server B should have the same name.
Direct access of Server B should be restricted.
The servers or instances occupied in DB mirroring must authenticate each other. Each instance login must have permissions to communicate to the other mirroring server and to its end points.
Abhijit is a Software Professional working in India for last 4 years and his expertise is on .Net technologies and Sql Server.
Article from articlesbase.com
Find More ASP.NET Articles
How to Send Email from your site using Gmail as your server using ASP NET
One of the most common tasks in Web development is sending an email. We often need to give our users a way to contact us by email. We can use a good mailing method in our sites in cases of “Contact us”, “I forgot my Password” or “I would like information on” links.
We can always use HTML Mailto method, but that means that we have to assume the user has a mail client on his computer. Sometimes we want to have more control on the way the mail is sent. Maybe we don’t want our user to know that a mail was sent. In my sites I have a Connection page that let users share their opinions with me in a well formatted form. When the user clicks on the Send button I use a send mail method behind the screens.
Using asp.net it is very easy to perform this action, and because all of us like to use free services I am going to use Gmail in order to demonstrate e-mail delivery via Gmail in ASP.NET code.
We are going to use two .net classes: SmtpMail and MailMessage. in order to use them we must import System.net.Mail. We can do it by writing the following line of code at the top of the page:
Imports System.Net.Mail.
Now, all we have left to do is to write a procedure that sends the email:
Send mail with the help of Gmail
Dim objMail As MailMessage = New MailMessage ()
objMail.To.Add (jane@cloudyflow.com)
objMail.To.Add (“jon@live.com”)
objMail.From = New MailAddress (“yourname@yourdomain.com”)
objMail.Subject = “Sending Emails using Gmail services”
Dim msg As String = “Cloud computing is great!”
objMail.Body = msg
objMail.IsBodyHtml = True
Dim smtp As SmtpClient = New SmtpClient ()
smtp.Host = “smtp.gmail.com” ‘Or any other SMTP Server
smtp.Credentials = New System.Net.NetworkCredential
(“yourname@gmail.com”, “password”)
smtp.EnableSsl = True
smtp.Send (objMail)
That’s it. You can copy and paste the code and use it in your own asp.net projects.
Yossi Sigura is a software engineer and a Cloud Computing expert with a passion for programming and programming languages. Yossi writes a few programming blogs among them are: http://www.codeanan.co.il and http://www.devschool.co.il
Article from articlesbase.com
Find More ASP.NET Articles
Advantages of using ASP.NET
ASP.NET has almost changed the way applications were being developed. By using the compiled languages like C# and VB it has given programmers and developers the freedom to build dynamic, rich websites and web applications with ease perfection and speed. It has come as a boon when the virtual world or www has taken a deep rooted role in human lives.
ASP.NET is not just about the script languages it allows the user to make use of .NET languages like C#, J#, VB etc. With the help of visual studio a developer can make very compelling applications. Its a purely server-side technology. ASP was initially introduced to make the static websites more dynamic that would update automatically without any human intervention. There were several top websites that readily embraced ASP. The likes of Amazon and eBay were quite benefited with ASP.
There are several points that make ASP.NET far better than other Web development models. The first and foremost is the drastic reduction in the code that is required to build large application. This time when saved can either be employed in other profit making activities or can else be converted in to the profits for an organization will be covering more projects in the same time.
Safety and security is another feature that is taken well care of in ASP.NET with built in windows authentication and per application configuration. Its simplicity makes it easy to perform common tasks like simple form submission to more complex functions such as client authentication to deployment and site configuration.
As .NET pages are easy to maintain and write it becomes quite easy to maintain a large site and do the modifications that are required. The source code is executed on the server. This provides a lot of power and flexibility to the web pages.
The application is always ready to accept and handle any request as all processes are closely monitored and managed by the ASP.NET runtime. All codes are executed on the server before they are sent to the browser. As ASP.NET is language independent thus you have the freedom to choose the language that best applies to requirements of your application.
The author is Microsoft certified .Net Professional who has rich experience of .Net frame work. He has worked on number of live projects. His current work is related to .net Obfuscators, .net Code Protection, .net obfuscation To know more about author and his work please visit.http://secureteam.terapad.com/
Article from articlesbase.com
Categories: ASP.NET Tags: Advantages, ASP.NET, Using
How to create forums using Asp.net?
First you must know that you can’t create any forum website with asp.net. ASP.NET is only a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services.
If you want to get a forum online at your own domain you will need a web host providing one of the forum softwares; vBulletin, phpBB or SMF. Some of the web hosts offer an installing service called “Fantastico”. By using this service, you can create your forum without difficulty, even if you are not skilled in using any software.
Watch this short video tutorial to learn how to create a forum website:
http://www.threehosts.com/publish/phpbb.html
To set up a forum website, there are six steps you will need to take:
Step 1: Register a domain name. A domain name is a name you want to call your website. For example, yahoo.com, articlesbase.com, threehosts.com or wikipedia.org.
Step 2: Buy a web hosting package providing phpBB, vBulletin or SMF to host your website online. A web hosting service provides you with online space and needed softwares. This enables you to get your forum online at your registered domain name. We recommend getting your domain and web hosting plan from the same company. This way, it is often possible to get your domain for free, due to some web hosting services offering a domain as a free gift today.
Step3: Install your favorite forum software. To do this automatically, install the forum software using Fantastico. Currently most web hosts have phpBB, vBulletin and SMF forum softwares available in their Fantastico. To install, you must first log into your web hosting account. Then choose the blue smiley face (called Fantastico) viewable on cpanel. Click on the desired forum software; they all look nearly the same. While phpBB is great for a new forum and has some great features, vBulletin is easier to use and maintain and is nicer to use. Select the domain name you would like to install the board to. The “Install in directory” box can be left empty in case you want to have your forum as the starting page for your website (http://www.yourdomain.com). You can specify a directory, e.g forum, in case you want to have your forum installed at http://www.yourdomain.com/forum.
Step4: Select the username and the password for the forum administrator.
Step5: Fill in the Site Name and the Short Description fields which will be appeared in the header of each page of your forum. Proceed by clicking Finish installation. You will be taken to a page with the administrative panel of the board.
Step6: Now, you can easily define the categories/sub-categories of the forum and manage them as the administrator.
****************************
All Web Hosts Presented On ThreeHosts.com Provide Forum Softwares- vBulletin & phpBB:
Threehosts.com is a reliable website to help you make the best choice. Their experts have been evaluating forum web hosting services for years, and now they provide you with the most reliable results. There you can reach the three reputable companies that are leaders in the forum web hosting industry.
http://www.threehosts.com/forum
Article from articlesbase.com
Reporting for Visual Studio Using ASP.NET Web Forms
When creating reports, it is important that you are able to obtain all the necessary pieces of information that you need so as to have an effective report. Most developers understand that there is a call for learning about reporting for Visual Studio. When making reports for a new client, there are different methods that you can use in order for you to take advantage of drill down feature of reporting for Visual Studio. One of the things that you have to learn about is how you can hide and unhide certain parts of your reports based upon your choice. You can use a Visual Studio report designer or you can choose to utilize the web forms from ASP.NET.
If you are developer at a certain company, you will most likely have the task to develop a product drill down report by category. Initially, your target is that the report should only display the product categories as well as the total number of products that are associated with every category there. Take note that this type of report is a typical report that is often requested by different departments in each organization. The advantage here is that this empowers the user to view only the required information specified by the user from the output. This is comparable to a tree view structure wherein you can hide or unhide a tree node by means of clicking on the plus or the minus sign.
If you decide that you will use reporting for Visual Studio through an asp.net web form and this is in drill down form, you will only have to work with Excel. This means that you will not be able to use PDF because this is a feature that is not supported by it. Otherwise, the output will be the last state of the report that you have made for the PDF file whether it is collapsed or expanded. To start off, you will have to get the asp.net web site prepared first. When this is ready, you can now begin with the reporting for Visual Studio crating process.
You will commence this through creating a data table. When it is done, you can now design the report layout. Do not worry here because this is not really a daunting task even though it might look like one. You will only have to know how you will be able to add a number of data groups along with the activity of setting some properties of the report layout. Other things that you have to know are how to add a header, setting up the page, page header designing and body section designing.
The last step is to write the code, which can be in C#. Make sure that you connect it to the database and implement the query so that you will be able to gather the data that you need. Once the data collection is completed inside the dataset, you can bind it to the report. You can use a report viewer so that you can view the report output.
Download trial version:
http://www.perpetuumsoft.com/Downloads.aspx?lang=en&pid=21
Perpetuum Software LLC specializes in development of high-quality .NET and ASP.NET software components compatible with MS Visual Studio .NET, C# Builder, Delphi .NET and other IDEs supporting .NET Framework. Such use-proven components as Report Sharp-Shooter, Instrumentation ModelKit, OLAP ModelKit, Chart ModelKit, the .NET Dashboard Suite, OLAP + CHART ModelKit and other .NET components by Perpetuum Software LLC are already well known on the software development market and are used by developers in more than 60 countries.
Article from articlesbase.com
Find More ASP.NET Articles
ASP.NET – Using Query Strings in order to Transfer data
There are different ways to transfer data from one page to another in ASP.NET.
Transferring information using Query strings is typically not recommended for reasons of security, but sometimes we have no choice but to use it. This is Particularly true in the following cases:
When we want to transfer information from a page in one site to a page located in another site;
When we want to pass information from an ASP.NET page to another page in the same site that is not written in ASP.NET.
In addition, we can use Query strings when we develop in an environment where security considerations are secondary. Such as intra-net environment or an environment where there is no meaning to permissions and security of data transferred from page to page.
The code we write on the sender would look like this:
‘ Send data to another page with Query string
http://targetdomain.com/sample.aspx?field1=value1&field2=value2
Please note that immediately after the name of the page to which we send the information to we need to add a question mark ‘?’ And then the name of the variable (in our case ‘field1′) and then an equal sign ‘=’ and the value of the field that we send. If we want to send more data then we need to put ‘&’ before every pair of fields and values.
The code we write in order to receive the data that was sent to a page will look like this:
‘ Get data from Query string
Dim sVal1 as String = Request.Querystring(Field1)
Dim sVal2 as String = Request.Querystring(Field2)
Please note: In order to transfer data from site to site we can also use Response.Redirect.
This article was first published in my Hebrew site for programming: www.devschool.co.il
Yossi Sigura is a software engineer and an expert in cloud computing and internet oriented software development. Yossi Is also the editor of several programming sites among them is Devschool and Codeanan
Article from articlesbase.com
How to begin Mobile Web Development using ASP.NET
Throughout the course of history of Web Development all information and content has went from static, to sites producing content “on demand” or dynamic if you will.
The object of this model was to deliver the information to Personal Computers, or MAC’s but it was never really designed for use on Mobile devices.
In comes the PDA. Those same sites don’t display properly on a PDA or cell phone.
Due to the fact that is uses a mini-browser and generally supports non-HTML markup.
In addition to not truly supporting HTML these devices have smaller CPUs, smaller I/O devices, and a nominal battery life at best.
All things considered for developers it is still imperative to build apps for these devices.
While building these apps they need to be simple, buy yet efficient due to the parameters that you are working with on a Mobile device.
To begin building a Mobile App using ASP.Net, you will need to use the System.Web.Mobile Namespace which is included in the .NET Framework.
The Namespace comes loaded with ASP.NET Mobile Controls, as well as authentication for your Mobile apps.
ASP.NET Mobile Namespace(s) Namespace Description System.Web.Mobile Includes core mobile functionality System.Web.UI.MobileControls.Adapters Includes Core adapter classes System.Web.UI.MobileControls Includes ASP.NET Mobile Controls
With the combination of these namespace you now have the building blocks, or as my friend Joe calls them “Legos” to be begin building a Mobile Application.
Once a request is made from the server to retrieve a page the System.Web.Mobile Namespace takes a look at the HTTP headers to determine the device type and the browser being used.
At this point the server produces the proper control from the System.Web.UI.MobileControls Namespace, and it also selects the coinciding adapter from System.Web.UI.MobileControls.Adapters based on the device type.
Compendium:
In this article I have given you the foundation to being using Mobile Controls.
Happy Coding
Keidrick Pettaway works as Systems Administrator / Web Developer at The University of South Alabama Library in the Systems Department. Feel Free to contact via his website at http://www.kpettaway.com
Article from articlesbase.com
More ASP.NET Articles
Effective web development using ASP NET programming. Find out how
ASP net programming is a web application developed by Microsoft. It is a powerful web application that allows programmers to build dynamic websites, web services and web applications.
There are two important things to note about ASP. It is not a programming language, but a technology that allows a web application development . The action involved in this technology takes place on the server and not the personal computer. When on a server, it can interpret different programming languages including JavaScript, PerlScript and VBScript. It is also possible to mix these languages on the same ASP web page framework in order to obtain better results.
In order to get started with it, you need a web server and a .NET framework. Make sure the web server supports the .NET framework. It can wither be Microsoft IIS (Internet Information Services) or an Apache 2 with mod_aspdotnet in it. Once the web server has bee set up, you need to consider the text editor you would use. Notepad on Windows or Emacs on Linux are good editor choices. Of late, Notepad ++ has been used extensively since it has enhanced features like syntax highlighting, enables FTP and an integrated word count function as well.
Here is the series of steps in creating a simple ASP.NET web page:
Choose and define the language you want to use on the framework. Typically it is C# or VB. Next, create a HTML form. Ping this form to the server you want to use. Any processing on the server should be carried out.
Return the necessary results to the client according to their requirements.
I am working as an asp net programmer in an
offshore web development company. ASP NET programming is one of my interests and I like to educate public about it through my articles.
Article from articlesbase.com
Related ASP.NET Articles
Categories: ASP.NET Tags: Development, Effective, Find, programming, Using
Using Linq to Objects in C#
This tutorial was created with Microsoft Visual Studio .NET 2008. However, if you are using 2005, you can implement LINQ by downloading Microsoft’s LINQ Community Technology Preview release from here.
In this tutorial, we will be looking at using LINQ to Objects. We will be creating a Windows Forms Application that will first define an array of numbers, and then we will use LINQ to Objects to interact with this collection of numbers. We will create buttons to display the results of calculations of the numbers, demonstrating the built-in functions of LINQ, that we can perform on most any collection.
We will start by designing our form with Four buttons and a label. The first button will be to display all the numbers in our array, which we will hard-code for this example. The label will be to show the results of our functions, and then the other three buttons we will use for LINQ functions.
We will also implement a StatusStrip control to make use of the label within, so that we can manipulate it on the mouse hover and leave events. The form may look something like this:
Once we are done with our form, we can double-click on the buttons in design view to create the click event handlers. We can also create the hover and leave handlers by clicking on the Events button in the Properties window, and then double-clicking on both of the MouseHover and MouseLeave events.
Let’s start with the statusstrip label. We will change the text on hover and leave of each of the buttons to let the user know what each of the buttons does:
private void button1_MouseHover(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “Display all numbers in array”; }
private void button1_MouseLeave(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “”; }
private void button3_MouseHover(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “Get SUM of all numbers”; }
private void button3_MouseLeave(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “”; }
private void button2_MouseHover(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “Get numbers less than 10″; }
private void button2_MouseLeave(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “”; }
private void button4_MouseHover(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “Get average of numbers”; }
private void button4_MouseLeave(object sender, EventArgs e)
{ toolStripStatusLabel1.Text = “”; }
Next, we will create a method that will create an array of numbers that we can call from all of the buttons:
You can review the rest of the articlie at LinQhelp.com Happy coding!
Article from articlesbase.com
More LINQ Articles