.net 控件和数据库连接失败
[code=C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace windows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
oleDbDataAdapter1.Fill(ds ,"Products");
dataGridView1.DataSource = ds;
}
}
}/code]
运行后出现:
未处理 System.Data.OleDb.OleDbException
Message="用户 'sa' 登录失败。"
Source="Microsoft SQL Native Client"
ErrorCode=-2147217843
很急。。。。。。。。