liuay
liuay
2016-04-18 02:41

c#连接sybase的时候报错

5
  • sybase
  • 数据库

ERROR=Parse failure on line 1 of statement 'use alerts', at or near 'alerts'

一直报这个错
代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sybase.Data.AseClient;
using System.Data;

namespace Test_Sybase
{
public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
AseConnection con = new AseConnection("Data Source=ip;database=data;charset=cp850;Port=5000;UID=sa;PWD=sa");
AseDataAdapter da = new AseDataAdapter("select * from alerts.status", con);
con.Open();
DataTable dt = new DataTable();
da.Fill(dt);
}
catch (Exception ex)
{

        }
    }
}

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答