Menu

Tuesday, March 22, 2011

Login in ASP.Net in VB using ADO.Net Entity Data Model


STEP 01:(Create the Module)
Public Module Class1
    Public conn As New TestingDatabesModel.TestingDatabesEntities
End Module


STEP 02:(Type The Code On Button(Login) Click)
        Dim LoginUser = conn.UserTables.FirstOrDefault(Function(f1) f1.UserName = txtUsername.Text And    f1.Password = txtPassword.Text)
        If LoginUser Is Nothing Then
            My.Response.Write("Invalid UserName/Password")
        Else
            My.Response.Redirect("Pages/Welcome.aspx")
        End If
    End Sub

Sunday, November 21, 2010

How To get User ID & Password text file?

Step1. Import "IO" package.
using System.IO;

Step2.Declarer Four String Variables.
string username = "";
string password = "";

string str1 = "";
string str2 = "";


Step3.Write Two StreamReader's Objects their Constructors & Path of the .txt Files
StreamReader sr1 = new StreamReader(@"c:\Foldername\\ID.txt");
StreamReader sr2 = new StreamReader(@"c:\Foldername\\Password.txt");

Step4.Write While Loop to Read ID & Password Files's Data.
while ((str1 = sr1.ReadLine()) != null)
{
username=str1;
}

while ((str2 = sr2.ReadLine()) != null)
{
password=str2;
}


Step5.Write "IF" Condition To check is ID & Password are correct.
if(txtUserID.Text==username && txtPasswoed.Text==password)
{
MessageBox.Show("Welcome");
}
else
{
MessageBox.Show("Invalid UserID or Password");
}

Monday, September 27, 2010

ASP.NET Special Folders

ASP.NET defines several Special folders.

When a new Web site is created the App_Data folder is created by default.
It can contain a SQL Server 2005 Express Edition database, another database, or an XML data file that will be used in the Web site.

These folders are protected by ASP.NET
For example, if a user attempts to browse to any of there folders
(except App_Themes)
User will receive an HTTP 403 Forbidden error.



Saturday, September 25, 2010

Insert Update Delete with XML

Create 2 Text Fields | TxtName, TxtEmail
3 Buttons | BtnAdd, BtnDelete, BtnEdit
1 Gridview | Gridview1
1 Label |  Label1

Right Click on Gridview select properties
In properties find columns
select CommandFields Add Select Field

Goto Solution Explorer 
Right click on App_Data folder and select add new item
Then select xml and name it users.xml

Friday, September 24, 2010

Text To Speech

The text entered in the textbox should come as a voice.







In Design View


Put one textbox or button