string cnxstr = "Data Source=moja_nazwa_serwera;Initial Catalog=ReportServer;Integrated Security=SSPI;"; //connection string
using (SqlConnection connection = new SqlConnection(cnxstr))
{
connection.Open();
SqlCommand command = new SqlCommand();
SqlCommand command = new SqlCommand();
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "FindObjectsNonRecursive";
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "FindObjectsNonRecursive";
command.Parameters.Add(new SqlParameter("@Path", "/nazwa_mojego_folderu"));
command.Parameters.Add(new SqlParameter("@AuthType", 1));
command.Parameters.Add(new SqlParameter("@AuthType", 1));
SqlDataReader reader = null;
try
try
{
reader = command.ExecuteReader();
while (reader.Read())
while (reader.Read())
{
string sciezka = reader["Path"].ToString();
//teraz możesz np. wyświetlić ją na liście
//teraz możesz np. wyświetlić ją na liście
}
}
finally
{
if (reader != null)
reader.Close();
}
{
if (reader != null)
reader.Close();
}
}