Click here to Skip to main content
15,891,248 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: geting error while accessing webservices.. Pin
vkumar0910-Jul-09 0:13
vkumar0910-Jul-09 0:13 
GeneralRe: geting error while accessing webservices.. Pin
Vasudevan Deepak Kumar10-Jul-09 2:35
Vasudevan Deepak Kumar10-Jul-09 2:35 
Questiontextbox Pin
mylogics9-Jul-09 23:54
professionalmylogics9-Jul-09 23:54 
AnswerRe: textbox Pin
padmanabhan N9-Jul-09 23:58
padmanabhan N9-Jul-09 23:58 
AnswerRe: textbox Pin
Blue_Boy10-Jul-09 0:01
Blue_Boy10-Jul-09 0:01 
AnswerRe: textbox Pin
mylogics10-Jul-09 0:08
professionalmylogics10-Jul-09 0:08 
GeneralRe: textbox Pin
padmanabhan N10-Jul-09 0:11
padmanabhan N10-Jul-09 0:11 
GeneralRe: textbox Pin
mylogics10-Jul-09 0:14
professionalmylogics10-Jul-09 0:14 
ok this is the full code:
private void InsertInfo()
{
SqlConnection conn = new SqlConnection(GetConnectionString());
string sql = "INSERT INTO PurchaseProduct(ProductCategoryId,ProductID,ProductName,BrandName,Price,Quantity,TotalPrice)values(@Val1,@Val2,@Val3,@Val4,@Val5,@Val6,@Val7)";
try
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.AddWithValue("@Val1",Txtcatid.Text);
cmd.Parameters.AddWithValue("@Val2",Txtproductid.Text);
cmd.Parameters.AddWithValue("@Val3",Txtproductname.Text);
cmd.Parameters.AddWithValue("@Val4",Txtbrandname.Text);
cmd.Parameters.AddWithValue("@Val5",Txtproductprice.Text);
cmd.Parameters.AddWithValue("@Val6",Txtproductquantity.Text);
int Total = int.Parse(Txtproductprice.Text) * int.Parse(Txtproductquantity.Text);// (Convert.ToInt32(Txtproductprice.Text) * Convert.ToInt32(Txtproductquantity.Text));
string total = Convert.ToString(Total);
Txttotalprice.Text = Total.ToString();
cmd.Parameters.AddWithValue("@Val7",Total);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
}
catch (System.Data.SqlClient.SqlException ex)
{
string msg = "Insert Error:";
msg += ex.Message;
throw new Exception(msg);

}
finally
{
conn.Close();
Txtcatid.Text = "";
Txtproductid.Text = "";
Txtproductname.Text = "";
Txtbrandname.Text = "";
Txtproductprice.Text = "";
Txtproductquantity.Text = "";
Txttotalprice.Text = "";

}
}
protected void Button1_Click(object sender, EventArgs e)
{
InsertInfo();
}
GeneralRe: textbox Pin
DoctorMick10-Jul-09 0:17
DoctorMick10-Jul-09 0:17 
GeneralRe: textbox Pin
Blue_Boy10-Jul-09 0:18
Blue_Boy10-Jul-09 0:18 
GeneralRe: textbox Pin
padmanabhan N10-Jul-09 0:23
padmanabhan N10-Jul-09 0:23 
GeneralRe: textbox Pin
Blue_Boy10-Jul-09 0:32
Blue_Boy10-Jul-09 0:32 
GeneralRe: textbox Pin
padmanabhan N10-Jul-09 0:43
padmanabhan N10-Jul-09 0:43 
GeneralRe: textbox Pin
DoctorMick10-Jul-09 0:52
DoctorMick10-Jul-09 0:52 
GeneralRe: textbox Pin
Blue_Boy10-Jul-09 0:55
Blue_Boy10-Jul-09 0:55 
GeneralRe: textbox Pin
Abhijit Jana10-Jul-09 5:31
professionalAbhijit Jana10-Jul-09 5:31 
AnswerRe: textbox Pin
padmanabhan N10-Jul-09 0:09
padmanabhan N10-Jul-09 0:09 
AnswerRe: textbox Pin
Vasudevan Deepak Kumar10-Jul-09 2:30
Vasudevan Deepak Kumar10-Jul-09 2:30 
Questionvalue in textbox Pin
mylogics9-Jul-09 23:45
professionalmylogics9-Jul-09 23:45 
AnswerRe: value in textbox Pin
Blue_Boy9-Jul-09 23:48
Blue_Boy9-Jul-09 23:48 
GeneralRe: value in textbox Pin
padmanabhan N9-Jul-09 23:57
padmanabhan N9-Jul-09 23:57 
AnswerRe: value in textbox Pin
DoctorMick10-Jul-09 0:15
DoctorMick10-Jul-09 0:15 
AnswerRe: value in textbox Pin
Brij10-Jul-09 2:15
mentorBrij10-Jul-09 2:15 
AnswerRe: value in textbox Pin
Abhijit Jana10-Jul-09 3:14
professionalAbhijit Jana10-Jul-09 3:14 
Questionerror Pin
mylogics9-Jul-09 23:26
professionalmylogics9-Jul-09 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.