Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Friday, March 30, 2012

Is it possible to prevent user to edit parameters in adress bar?

I have reports in report server which are accessed by url access with parameters.

When the report is generated the whole url string is displayed in the adress bar with parameters. Is there any way to prevent the user to change the parameter value?

Any ider whould be very appreciated!

You could use a html form and use POST instead of using GET via the url.

See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=301748&SiteID=1

Wednesday, March 21, 2012

Is it possible to custom format the parameter dropdownlist?

I have a reporting services 2000 report that has only one string report
parameter with a prompt 'Select a Project'. The project list contains
project names that are so long that they take up about 95% of the page
width and the View report button becomes a partially visible button
with a horizontal scroll bar to scroll further to the right to view the
entire page.
My users hate to have to scroll to the right. They are requesting a
fixed width dropdownlist with fully visible 'View report' button.
We want to make our DDL pretty narrow so that it only shows the first n
characters of the project name string when the DDL is not dropped down.
When the user
drops the list down we want to resize it wide enough to show the entire
string.
We could also assign a tool tip to the DDL if we could supply a unique
tip
to each row in the DDL?
Any ideas? Does SSRS 2005 let the designer specify the parameter
control width?
Many thanks in advance.I've found that the parameter panel is not at all configurable and have
been creating a front-end web page for each report giving me total
control over presentation. Then I hide the parameter panel via a
parameter on the URL. It's my understanding RS 2005 has more control
over the parameter panel.|||Many thanks, Kent.

Is it possible to create thread & start from CLR Stored Proc

My simple CLR Stored procedure is as below:

[Microsoft.SqlServer.Server.SqlProcedure]
public static int MyParallelStoredProc(string name1, string name2)
{
Thread t = null;
Worker wth = null;
int parallel = 2;
Object[] obj = new object [parallel];
SqlPipe p;
p = SqlContext.Pipe;

for (int i = 0; i < parallel; i++)
{
if (i == 0)
wth = new Worker(name1);
else
wth = new Worker(name2);
t = new Thread(new System.Threading.ThreadStart(wth.WorkerProc));
t.Name = "Thread -" + i.ToString() + ":";
t.Start();
p.Send(t.Name + ":Started");
obj[ i] = t;
}
for (int i = 0; i < parallel; i++)
{
t = (System.Threading.Thread)obj[ i];
t.Join();
p.Send(t.Name + ":Finished");
}
return 0;
}

The worker class implementing Thread Proc:

public class Worker
{
private string Name;

public Worker(string name)
{
SqlPipe p;
p = SqlContext.Pipe;
Name = name;
p.Send("In Constructor:" + Name);
}

public void WorkerProc()
{
SqlPipe p;
p = SqlContext.Pipe;
for (int i = 0; i < 10; i++)
p.Send(i.ToString()+":"+Name);
}
}

The assembly is registered with UNSAFE permission set.

CREATE ASSEMBLY
ThreadTest
FROM
'C:\\ThreadTest\bin\Debug\ThreadTest.dll'
WITH
permission_set = unsafe;
GO

CREATE PROC ParallelStoredProc
@.Name1 NVARCHAR(1024),
@.Name2 NVARCHAR(1024)
AS
EXTERNAL NAME ThreadTest.[MyTest.ThreadTest].MyParallelStoredProc

When I invoke the the stored procedure from T-SQL script as below,

EXEC ParallelStoredProc @.Name1, @.Name2

the thread class constructor gets called; but the 'WorkerProc' does not execute ?

Whether an UNSAFE assembly is allowed to spawn threads

inside SQL Server ?

Your code works correctly to start and run threads under unsafe. The reason you think it doesn't work is because the SqlContext connection is not available on new threads, so you can't use it to Pipe.Send information back.

If you try/catch for exceptions in your WorkerProc, you should see an error like the following:

"The requested operation requires a Sql Server execution thread. The current thread was started by user code or other non-Sql Server engine code."

Steven

|||

Thanks steve. Your input was very useful.

If I use SqlConnection in WorkerProc, the thread gets aborted

and goes into "Stopped" state.

It means the main CLR Stored proc can only execute the T-SQL commands ?

WorkerProc's are restricted to computations.

Monday, March 12, 2012

Is it possbile to define Database server and web server on different machine (Not same phy

Hi All,

Is it possbile to define connection string for web and database server which is running on different machine. Note( Not same LAN).

E.g (My Web Server is in London and Database server in Sydney).

Please can any one help me.??

Thanks in advance...

Dj

They dont need to be on the same LAN, but you'll still need a viable WAN link.

To connect you could use the remote servers IP address with sql credentials.

data source=192.x.x.x;initial catalog=yourDatabase;user id=yourUsername;password=yourPassword;