Reporting Service创建数据源问题!

leo_asp 2006-12-06 01:35:54
Reporting Service自带的服务管理器可以通过代码上传报表,但是我没有找到用代码创建数据源,请教各位了。
...全文
229 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
难得胡涂 2006-12-06
  • 打赏
  • 举报
回复
DataSourceDefinition dsd = new DataSourceDefinition();
dsd.CredentialRetrieval = CredentialRetrievalEnum.Store;
dsd.ConnectString = txtSQLConnectionString.Text;//数据库链接串
dsd.Enabled = true;
dsd.EnabledSpecified = true;
dsd.Extension = "SQL";//数据库类型
dsd.ImpersonateUser = false;
dsd.ImpersonateUserSpecified = true;
dsd.Prompt = null;
dsd.UserName = txtUserName.Text;//用户名
dsd.Password = txtPassword.Text;//密码
dsd.WindowsCredentials = false;

try
{
rs.CreateDataSource(DataSourceName, ServerPath, true, dsd, null);//DataSourceName: 你要创建的数据源名, ServerPath: 创建在某个子目录
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}

6,108

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 数据库报表
社区管理员
  • 数据库报表社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧