Solved

login failed

Posted on 2008-10-19
1
159 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
1 Comment
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now