CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Threaded View

  1. #3
    Join Date
    Jun 2009
    Posts
    35

    Re: Help in Publish Website + ASP.net + C#

    I have earlier SQL 2005 Express Edition install..I remove it from control panel.But its not completely remove,can somebody tell me how to completely remove it. Cz now I m using SQL Server 2000 ,even if i craete the user & connect to DB using SQL server authentication,I m still getting the same error..My frnd told me to completely uinstall SQL 2005 might solve this errror!!!!!

    Can somebody tell y i m getting the same error even if I connect using SQL authentication???? Is the reason same told by mine frnd!!!

    Tell me one thing more ,Suppose while creating a user , Suppose i give username A & default databse is sonia..& there is also other user named B whose default DB is sardana.

    SO can i use the username A to connect to DB sardana or only username A can be used to connect to DB sardana .




    Mine update Code,Still getting the same Error

    Code:
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient; 
    
    public partial class FrmRegistration : System.Web.UI.Page
    {
    
        SqlConnection conn = new SqlConnection("Data Source=(local);Initial catalog=sonia;User ID=sonia;Password=sonia;Integrated Security=true");
        string query;
        SqlCommand cmd;
    
        //http://www.daniweb.com/forums/thread213382.html
        protected void Page_Load(object sender, EventArgs e)
        {
            btnSubmit.Attributes.Add("onclick", "Javascript: return Validations() ");
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            query = "Insert into UserInfo values(@name,@email)";
            cmd = new SqlCommand(query, conn);
            conn.Open();
            cmd.Parameters.AddWithValue("@name", txtName.Text);
            cmd.Parameters.AddWithValue("@email", txtEmail.Text);
            cmd.ExecuteNonQuery();
            conn.Close();
            Session["Name"] = txtName.Text;
            Session ["Email"]=txtEmail .Text ; 
            Response.Redirect("FrmUserDetails.aspx");
          
        }
    }
    Last edited by sonia.sardana; August 26th, 2009 at 01:50 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured