Search : in
By :

Insert data using asp.net web application

ali, on Jun 17, 2009 7:11:28 am BST 
 Report this message to moderators

I want to insert data using asp.net web application through Sql 2005..

Code:

private void ConnectionDetails()
{
SqlConnection con = new SqlConnection("Data Source=ALIASGAR-EAE104;Initial Catalog=RajaCompany;Integrated Security=True;Database=RajaCompany;user id=sa;password=sql2005");
//con.Open();
//con.ConnectionString = "Data Source=ALIASGAR-EAE104;Initial Catalog=RajaCompany;Integrated Security=True;Database=RajaCompany;user id=sa;password=sql2005";

SqlCommand cmd = new SqlCommand("Insert * INTO Client Details(Client Name, Client Number, Client Email, Purpose, Qutation, Qutation Date, Client Address, Comments, Meeting Date) VALUES ( '" + txtClient.Text + "', '" + txtNumber.Text + "', '" + txtmail.Text + "', '" + txtpurpose.Text + "', '" + txtqutation.Text + "', '" + QutationCal.SelectedDate + "', '" + txtAddress.Text + "', '" + txtComments.Text + "', '" + MeetingCal.SelectedDate + "')", con);
con.Open();
DataSet ds = new DataSet();
cmd.ExecuteNonQuery();
}






//private object mbox(string p)
//{
// throw new Exception("The method or operation is not implemented.");
//}
protected void Button1_Click(object sender, EventArgs e)
{
//ClientDetailDataSource.Insert();
int score = Convert.ToInt32 (Validate());
// if (score < 7)
// {
// error_label.Visible = true;

// }
// else
// {
// error_label.Visible = false;
// Response.Redirect("ClientData.aspx?");
// }
if (score < 7)
{
error_label.Visible = true;

}
else
{
error_label.Visible = false;
SqlDataSource1.Insert();
Response.Redirect("ClientData.aspx?");
}
}

Configuration: Windows XP
Firefox 3.0.11

Best answers for « Insert data using asp.net web application » in :
Download ASP/PHP Web Application Builder Show ASP/PHP Web Application Builder is a simple database development application. Since it is very simple, it does not require any knowledge on programming, it easily allows you to create your databases with ASP and PHP languages. ASP/PHP Web...
WINE-Running Windows applications under Linux ShowWINE-Running Windows applications under Linux Installation Test Install a software Directories Notes Wine is a software to run some Windows applications under Linux. Unlike VMWare or VirtualBox, Wine n'émule not a full PC, but...
How to insert picture background on Microsoft! ShowHow to insert picture background on Microsoft! To make a work sheet more appealing, you can add picture to your background. Below is a tip for doing so. Open your Microsoft and select Format> Backgrounds > Printed Watermarks in the menu...
Visual FoxPro ShowVisual FoxPro Visual FoxPro (VFP) is a very powerful tool marketed by Microsoft since 1995. It includes a programming language, an engine for relational database and an integrated development environment (IDE), which allows developers...
Download .NET Framework ShowMicrosoft .NET Framework 3.5 contains new features which have been built upon .NET Framework 2.0 and 3.0, and includes .NET Framework 2.0 service pack 1 and .NET Framework 3.0 service pack 1. Microsoft .NET Framework 3.5 includes: - ASP .NET AJAX...
Application Service Provider (ASP) ShowApplication service concept The term ASP (Application Service Provider) refers to the provision, by a provider, of an application which can be used via networks. This term therefore refers to outsourcing of the hosting of an application or an...
Data tampering attacks ShowMost web application attacks involving soliciting a website with manually entered data to generate an unexpected context. Web application parameters The HTTP protocol, a communication protocol on the web, makes it possible to convey parameters in...
Frames ShowIntroduction to Frames You can display multiple HTML pages in different areas at once. These areas are called frames. Frames are not found in the specifications of HTML 3.x, so the Document Type Declaration must show the page as having been...