?
Solved

login failed

Posted on 2008-10-19
1
Medium Priority
?
166 Views
Last Modified: 2010-04-15
please look at the code, what is wrong?
public partial class _Default : System.Web.UI.Page 
{
    SqlConnection conn = new SqlConnection("Data Source=ITNB;Initial Catalog=Events;User ID=haris, pwd=haris");
    SqlDataAdapter da = new SqlDataAdapter();
    DataSet ds = new DataSet();
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("select * from eventstable",conn);
        cmd.CommandType = CommandType.Text;
        conn.Open();
        da.SelectCommand = cmd;
        da.Fill(ds);
        conn.Close();
    }
}

Open in new window

0
Comment
Question by:harisbscs2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 22751429
your connection string is wrong, you have a comma instead of semicolon between the userid and password:
SqlConnection conn = new SqlConnection("Data Source=ITNB;Initial Catalog=Events;User ID=haris; pwd=haris");

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question