Hi all, i am new to VB.NET/ASP.NET. I need a sample project for an online banking (login and view transactions). does anyone have a sample project, or anything that is close to it???
even if you have only a sample login form, i will really appreciate.
thanks in advance.

Dani AI

Generated

A compact, practical add-on for the thread: the simplest working pattern for “login + view transactions” is a) a small users table (id, username, passwordHash, passwordSalt, role), b) a transactions table (id, userId, date, amount, type, description), and c) server-side checks that always use parameterized queries and strong password hashing. ’s form-driven approach is fine for learning, and ’s download is a useful starting point, but those examples in the thread show common gaps (plain-text passwords, SQL string concatenation). ’s point about forms authentication and denying anonymous access is correct — combine that with HTTPS and least-privilege DB accounts. ’s permission question is best solved with roles/permissions stored in the DB and enforced on every request.

Minimal VB.NET helpers (hash + verify) and a safe login query pattern:

Imports System.Security.Cryptography
Imports System.Data.SqlClient

' create salt
Public Function CreateSalt() As Byte()
  Dim s(15) As Byte
  Using rng As New RNGCryptoServiceProvider()
    rng.GetBytes(s)
  End Using
  Return s
End Function

' PBKDF2 hash
Public Function HashPassword(pw As String, salt As Byte()) As Byte()
  Using k = New Rfc2898DeriveBytes(pw, salt, 10000)
    Return k.GetBytes(32)
  End Using
End Function

Example: fetch stored hash/salt with a parameterized query, then call HashPassword and compare using a fixed-time compare. Use the returned user id to query transactions (parameterized):
SELECT TransactionID, TxnDate, Amount, TxnType, Description FROM Transactions WHERE UserId = @userId ORDER BY TxnDate DESC

Practical checklist: never store plain passwords; always use parameterized queries or stored procedures; protect connection strings in web.config; enforce HTTPS; keep sessions short; test with dummy data; prefer built-in providers (ASP.NET Membership/Identity) if not comfortable rolling a custom auth system. For a learning prototype an Access file is OK, but for anything realistic use SQL Server and proper role-based checks.

Recommended Answers

All 12 Replies

do as i said-
1)open a form-drag&drop 2 labels,2textboxes& a button
2)on a button name it has (SUBMIT-button)
3)
create a table in sql-server with ur desired tablename
4)the table should have two fields-name,password.
5)entire the data into fields in database.
6)click on the submit button-of the form(in code-behind file)
just paste this code................................


Private Sub sub_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sub_btn.Click
Dim cnn1 As String = ConfigurationSettings.AppSettings("preeconn")
Dim cmd As New SqlCommand("select * from tablename where password = & _ password.text & " ' )", New SqlConnection(cnn1))
cmd.Connection.Open()
cmd.ExecuteNonQuery()
cmd.Connection.Close()
loaddata()
End Sub


Private Sub LoadData()
Dim strSQL As String = "SELECT * FROM tablename "
Dim cnn As String = ConfigurationSettings.AppSettings("preeconn")
Dim cmd As New SqlCommand(strSQL, New SqlConnection(cnn))
cmd.Connection.Open()
Dim myCommand As New SqlDataAdapter(strSQL, cnn)
Dim ds As New DataSet
myCommand.Fill(ds, "table1")
cmd.Connection.Close()
cmd.Connection.Dispose()
End Sub
----------------------------------
in pageload. place this loadata() function
And u get the desired..reply m when ur done or when u have any queries...

i'm doing some similiar project.. but how do i give different permission to different user? i mean like user A can view transaction out while user B can view transaction in.

Here is the best sample I have for you. It implements a sample login system using Ascess DB. You can also read the full article and download the source here

Let me know if you need further help.

ok thanx very much for the help friends!! :)

So was my article of any help?

Hey binoj_daniel, i'm stuck with the step 4. i have tried the example which is your article but I can't understand the 'Step4'. where should I put the code?
thx in advance :)

Thats the codebehind page for the login.aspx page, every aspx page has a codebehind page.

Which ver. of VS are you using, 2003 or 2005?

i'm so sorry for the delay, actually i am also practicing java programming meanwhile.

I am using VS2003

Hi,

You assume there are two text box controls to accept user name and password and button control on login form.

void Button_Click(object sender, System.EventArgs e)
{


if (Page.IsValid)
{
switch (VerifyPassword( txtUsername.Text, txtPassword.Text )) {
case 0:
FormsAuthentication.RedirectFromLoginPage( txtUsername.Text, chkPersist.Checked );
break;
case 1:
lblError.Text = "You did not enter a valid username";
break;
case 2:
lblError.Text = "You did not enter a valid password";
break;
}


}
}


int VerifyPassword( string strUsername, string strPassword ) {
string strConString;
SqlConnection conJobs;
SqlCommand cmdVerify;
SqlParameter parmReturn;


strConString = "Data Source=202.XX.XXX.XX;database=jobsabc;User ID=jobs123;Password=cd546dc;";
conJobs = new SqlConnection( strConString );
cmdVerify = new SqlCommand( "VerifyPassword", conJobs );
cmdVerify.CommandType = CommandType.StoredProcedure;
parmReturn = cmdVerify.Parameters.Add( "@return", SqlDbType.Int );
parmReturn.Direction = ParameterDirection.ReturnValue;
cmdVerify.Parameters.Add( "@username", strUsername );
cmdVerify.Parameters.Add( "@password", strPassword );
conJobs.Open();
cmdVerify.ExecuteNonQuery();
conJobs.Close();
return (int)cmdVerify.Parameters["@return"].Value;
}

Changes for web.config file for the root directory.

<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true"/>
<authentication mode= "Forms">
<forms name=".JobskenCookie" loginUrl="/sitejob/sitepass/loginform.aspx" />
</authentication>
</system.web>
</configuration>

In the above code, sitepass is the password protected subfolder.

Changes for web.config file for the password protected folder. You keep all the password protected .aspx files (which are related to transactions) in this folder.

<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true"/>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>

Hope this helps.

How to program transactions in ASP.net

So were you able to use it now? Let me know?

hi i want to sample application project .net windows based application immediately

hi,i really need a vb program in banking but i dnt knw hw..i jst need a simple one.that i can veiw the widrawal and deposit

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.