Click here to Skip to main content
15,911,039 members

Comments by Member 10347358 (Top 2 by date)

Member 10347358 24-Nov-13 7:06am View    
Anyone please tell me the error i just can't get it
and getting this error again and again
No mapping exists from object type System.Web.UI.WebControls.RadioButtonList to a known managed provider native type

Member 10347358 24-Nov-13 7:05am View    
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
public partial class Registration : System.Web.UI.Page
{
string str = ConfigurationManager.ConnectionStrings["connect"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{

SqlConnection con = new SqlConnection(str);
con.Open();
SqlCommand cmd = new SqlCommand("insert into Login(Uname,LastName,Pass,Usertype,Email,Mobile,CollegeId,CurrentAddress,PermanentAddress,DOB,Gender,Branch,ImageId) values(@1,@2,@3,@5,@6,@7,@8,@,@9,@10,@11,@12,@13,@14)",con);
cmd.Parameters.AddWithValue("@1", TextBox1.Text);
cmd.Parameters.AddWithValue("@2", TextBox2.Text);
cmd.Parameters.AddWithValue("@3", TextBox3.Text);
cmd.Parameters.AddWithValue("@5", DropDownList1.SelectedValue);
cmd.Parameters.AddWithValue("@6", TextBox4.Text);
cmd.Parameters.AddWithValue("@7", TextBox5.Text);
cmd.Parameters.AddWithValue("@8", TextBox6.Text);
cmd.Parameters.AddWithValue("@9", TextBox7.Text);
cmd.Parameters.AddWithValue("@10", TextBox8.Text);
cmd.Parameters.AddWithValue("@11", Calendar1.SelectedDate.ToShortDateString());
cmd.Parameters.AddWithValue("@12", CheckBoxList1.SelectedValue);
cmd.Parameters.AddWithValue("@13", DropDownList2.SelectedValue);
if(FileUpload1.HasFile)
{
FileUpload1.SaveAs(Server.MapPath("~/images/")+FileUpload1.FileName);
}
cmd.Parameters.AddWithValue("@14",FileUpload1.FileName );
int j=cmd.ExecuteNonQuery();
con.Close();
Response.Redirect("Login.aspx");

}
}