PDA

View Full Version : Namespace مربوط به report



amir.far62
دوشنبه 30 مرداد 1385, 23:41 عصر
من برای LogOn کردن در کریستال از تابع زیر استفاده کردم اما در
foreach(Table table in Report.Database.Tables) خطا روی میدهد که مربوط به Report است برای استفاده از Report از کدام namespace باید استفاده کرد.
private void LogonToReport(string server, string database,
string ID, string password)
{
TableLogOnInfo logonInfo = new TableLogOnInfo();
// Set the logon information for each table.
foreach(Table table in Report.Database.Tables)
{
// Get the TableLogOnInfo object.
logonInfo = table.LogOnInfo;
// Set the server or ODBC data source name, database name,
// user ID, and password.
logonInfo.ConnectionInfo.ServerName = server;
logonInfo.ConnectionInfo.DatabaseName = database;
logonInfo.ConnectionInfo.UserID = ID;
logonInfo.ConnectionInfo.Password = password;
// Apply the connection information to the table.
table.ApplyLogOnInfo(logonInfo);
}
}

amir.far62
سه شنبه 31 مرداد 1385, 12:27 عصر
کسی نیست منو راهنمایی کنه ?

M.GhanaatPisheh
چهارشنبه 01 شهریور 1385, 11:43 صبح
1- کدهاتون رو توی تگCode قرار بدید تا کدهای بالا قابل مطالعه باشن.
2- متن خطا رو اینجا بگذارید.

AMIR_EMAMI
یک شنبه 09 مهر 1385, 21:37 عصر
private void LogonToReport(string server, string database,
string ID, string password)
{
TableLogOnInfo logonInfo = new TableLogOnInfo();
// Set the logon information for each table.
foreach(Table table in Report.Database.Tables)
{
// Get the TableLogOnInfo object.
logonInfo = table.LogOnInfo;
// Set the server or ODBC data source name, database name,
// user ID, and password.
logonInfo.ConnectionInfo.ServerName = server;
logonInfo.ConnectionInfo.DatabaseName = database;
logonInfo.ConnectionInfo.UserID = ID;
logonInfo.ConnectionInfo.Password = password;
// Apply the connection information to the table.
table.ApplyLogOnInfo(logonInfo);
}
}