I used nvarchar(max) datatype and prefixed the values by N while inserting but it inserts values @name,@address....
my code is as follows
| ??? : | ???????? ??? | ????? | |||||
| ???? | ???? ?????? | ???? ????? | |||||
| ???? ??? | ???? | ??? | |||||
| ?????? | ??????? ????? | ??????? ?????? | |||||
| ?????? | ??????? / ????? | ??????? | |||||
| ?? |
???????? ??????.
| ???????? ??? | ???? ??? | ???????? ???????/????? | |||||
| ??? | ???? | ??????? ??? | |||||
| ??????? ????? | ??????? ??????? |
| ??? | ?? | ||||||
| ???? | | ???? | ????? |
?????? ?????
| ????? | ???? | ?????? ??????? |
| User ID |
???? ?????
| ???? |
| |
and c# code is :protected void btnSubmit_Click(object sender, EventArgs e)
{
paswd = this.getrandomno();
try
{
string Height = ddHeight.SelectedValue.ToString();
string weight = ddWeight.SelectedValue.ToString();
string ras = ddras.SelectedValue.ToString();
string gan = ddgan.SelectedValue.ToString();
string bloodgrp = ddBloodgrp.SelectedValue.ToString();
string maritalStatus = ddMaritalStatus.SelectedValue.ToString();
int len = FileUpload1.PostedFile.ContentLength;
byte[] pic = new byte[len];
HttpPostedFile img = FileUpload1.PostedFile;
FileUpload1.PostedFile.InputStream.Read(pic, 0, len);
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["MahatmaPhule"].ToString();
con.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO userRegistration(firstName,middleName,lastName,gender,dob,birthplace,birthtime,height,weight,bloodgrp,physicalStatus,maritalstatus,education,occupation,income,fatherName,motherName,fatherOccupation,nofbrother,nofsister,mamaName,mamaAddress,mamaOccupation,ras,gan,manglik,devak,gothra,address,email,mobileNo,userId,photo) VALUES(N'@firstName',N'@middleName',N'@lastName',N'@gender',@dob,N'@birthplace',@birthtime,@height,@weight,@bloodgrp,N'@physicalStatus',N'@maritalstatus',N'@education',N'@occupation',@income,N'@fatherName',N'@motherName',N'@fatherOccupation',@nofbrother,@nofsister,N'@mamaName',N'@mamaAddress',N'@mamaOccupation',N'@ras',N'@gan',N'@manglik',N'@devak',N'@gothra',N'@address',@email,@mobileNo,@userId,@photo)", con);
cmd.Connection = con;
cmd.Parameters.AddWithValue("@firstName", txtName.Text);
cmd.Parameters.AddWithValue("@middleName", txtMiddleName.Text);
cmd.Parameters.AddWithValue("@lastName", txtSurname.Text);
cmd.Parameters.AddWithValue("@gender", rdGender.SelectedValue);
cmd.Parameters.AddWithValue("@dob", txtDOB.Text);
cmd.Parameters.AddWithValue("@birthplace", txtbrtplace.Text);
cmd.Parameters.AddWithValue("@birthtime", txtbrtTime.Text);
cmd.Parameters.AddWithValue("@height", Height);
cmd.Parameters.AddWithValue("@weight", weight);
cmd.Parameters.AddWithValue("@bloodgrp", bloodgrp);
cmd.Parameters.AddWithValue("@physicalStatus", rdph.SelectedValue);
cmd.Parameters.AddWithValue("@maritalstatus", maritalStatus);
cmd.Parameters.AddWithValue("@education", txtEducation.Text);
cmd.Parameters.AddWithValue("@occupation", txtJob.Text);
cmd.Parameters.AddWithValue("@income", txtIncome.Text);
cmd.Parameters.AddWithValue("@fatherName", txtFathersName.Text);
cmd.Parameters.AddWithValue("@motherName", txtMothersName.Text);
cmd.Parameters.AddWithValue("@fatherOccupation", txtFatherjob.Text);
cmd.Parameters.AddWithValue("@nofbrother", txtNobrother.Text);
cmd.Parameters.AddWithValue("@nofsister", txtNoSister.Text);
cmd.Parameters.AddWithValue("@mamaName", txtMamaName.Text);
cmd.Parameters.AddWithValue("@mamaAddress", txtMamaAddr.Text);
cmd.Parameters.AddWithValue("@mamaOccupation", txtMamaJob.Text);
cmd.Parameters.AddWithValue("@ras", ras);
cmd.Parameters.AddWithValue("@gan", gan);
cmd.Parameters.AddWithValue("@manglik", rdMaglik.SelectedValue);
cmd.Parameters.AddWithValue("@devak", txtdevak.Text);
cmd.Parameters.AddWithValue("@gothra", txtgotra.Text);
cmd.Parameters.AddWithValue("@address", txtAddre.Text);
cmd.Parameters.AddWithValue("@email", txtEmail.Text);
cmd.Parameters.AddWithValue("@mobileNo", txtMobileNo.Text);
cmd.Parameters.AddWithValue("@userId", txtuserid.Text);
cmd.Parameters.AddWithValue("@photo", pic);
int c = cmd.ExecuteNonQuery();
if (c > 0)
{
string strScript = "";
Page.RegisterStartupScript("PopUp", strScript);
}
else
{
string strScript = "";
Page.RegisterStartupScript("PopUp", strScript);
}
}
catch (Exception ex)
{
throw ex;
}
plz help me to solve this problem
its shows output as @firstName,@middleName.......
Kunal VaishyaPosted Apr 26, 2014, 3:14 AM
Please do one thing in database, change the field type nvarchar and let try.
nothing to do any special for this.
Regards,
Kunal.
Devendra DighePosted Apr 23, 2014, 5:09 AM
Gopi ChandPosted Apr 23, 2014, 5:06 AM
in spite of this lengthy process, why don't u go with google translator.
(just try to write it in English, that's all.)
:)