Simple Visitor Feedback Application

This application has designed for get feedback on “Dayata Kirula 2011 exhibition” in the BIIT stall.

This application has developed by using Microsoft Expression Blend and Windows Presentation Framework. To design the GUI in WPF it used XAML language. And all the feedback texts will save in the access database. Try to develop this application and it will useful someday.

this is the GUI before submit any feedback.

this is after comment.

Here is the code behind the GUI.I have used C# to code this project and you can use either C# or VB.Net to code this. You want to download and install .net framework 4 to run this application and you want visual studio 2010 to edit this project.

C# code…..

using System.Windows;
using System.Data.OleDb;namespace comment
{

public partial class MainWindow : Window
{
OleDbConnection conn = new OleDbConnection();
string [] fname = new string[5]; // decalre array for store first name
string[] comment = new string[5];// declare array forstore second name
int count = 0; // define and initialize the count variable

public MainWindow()
{
this.InitializeComponent();

}

public void clear()
{
txtaddress.Text =””; // clear all the fields after insert data
txtcomment.Text = “”;
txtemail.Text = “”;
txtfname.Text = “”;
txtlname.Text = “”;
txttelephone.Text = “”;

}

private void submit_clicked(object sender, System.Windows.RoutedEventArgs e)
{
string query = “INSERT INTO usercomment(FName,LName,Address,Email,TP,Comment)
VALUES( ‘” + txtfname.Text + “‘,'” + txtlname.Text + “‘,'” + txtaddress.Text +
“‘,'” + txtemail.Text + “‘,'” + txttelephone.Text + “‘,'” + txtcomment.Text + “‘)”;

// sql statement to insert data from text boxes

connection con = new connection();// create new object
conn = con.mycon();// get the connection
OleDbCommand insrtcommand = new OleDbCommand(query, conn);

conn.Open();// open the connection
try
{

int countd = insrtcommand.ExecuteNonQuery();
//

if (count > 4)
{
// if the count value greater than 4 set value 0 to count variable
count = 0;
}

fname[count] = txtfname.Text; // getting data from user and store those data in a array
comment[count] = txtcomment.Text;

// display data in the right coloum labels

lblonename.Text = fname[0];
lbltwoname.Text = fname[1];
lblthreename.Text = fname[2];
lblfourname.Text = fname[3];
lblfivename.Text = fname[4];

lblonecomment.Text = comment[0];
lbltwocomment.Text = comment[1];
lblthreecomment.Text = comment[2];
lblfourcomment.Text = comment[3];
lblfivecomment.Text = comment[4];

count = count + 1; // increas the value by one

}

catch (OleDbException ex)
{

MessageBox.Show(ex.Message);// if the exception coccure handle it
}

finally
{
conn.Close(); // close the connection
}

clear();// call the method
}

private void btnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();

// close the window
}

private void btnMin_Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
// minimize the window
}

}

}

download the complete project with source codes here
Download Microsoft .NET Framework 4 (Standalone Installer) from here

You can check the demo application separately.Click here and open the .exe called comment.Enjoy it buddy

dreamhost reviews

4 thoughts on “Simple Visitor Feedback Application

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s