TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
aditya immadi
NA
205
71.3k
Conversion failed when converting the nvarchar value 't5sxdb
Oct 18 2013 3:10 AM
Hai all,i have a small problem here.
protected void Page_Load(object sender, EventArgs e)
{
string id = System.Web.HttpContext.Current.Session.SessionID;
if (IsPostBack==false)
{
string connn = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
SqlConnection con = new SqlConnection(connn);
con.Open();
string str = "select decription,url from tb_userdata inner join tb_userlogin on tb_userdata.uidfromtb1=tb_userlogin.id where tb_userlogin.id=@id";
SqlCommand cmd = new SqlCommand(str,con);
cmd.Parameters.AddWithValue("@id", id);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);...............at this line i got this error
Conversion failed when converting the nvarchar value 't5sxdbfbcwlpfsdmv4t1amyx' to data type int.
DataList1.DataSource = ds;
DataList1.DataBind();
}
and my table is
CREATE TABLE [dbo].[tb_userdata](
[id] [int] NOT NULL,
[uidfromtb1] [int] NOT NULL,
[Name] [nvarchar](max) NULL,
[decription] [nvarchar](max) NULL,
[url] [nvarchar](max) NULL
) ON [PRIMARY]
i thoght evrythibg is fine .what is wrong with my code.anyone help me out
Thanks and Regards
Reply
Answers (
2
)
How to generate a ID from a PC .
object refrence not set to an instance of an object in asp.