Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Monday, March 26, 2012

Is it possible to have a List box or a combo box instead of a Drop downlist

Hi

Is it possible to have a list box or a combo box for selecting parameters instead of having a drop down list...

and If yes how can i do it?

Regards

Karen

Sure you can. Just drag a listbox control onto your page. Set the autopostback property to true if you want to allow postback and SelectionMode to Multiple if you want to allow more than one item to be selected. Then to access the items programmatically, you can do something like this.

Dim xAsString =String.Empty

For iAsInteger = 0To ListBox1.Items.Count - 1

If ListBox1.Items(i).Selected =TrueThen

x = x & ListBox1.Items(i).Text &","

EndIf

Next

|||

Thanks adyle,

it is possible to do this in the report manager??

Regards

Karen

|||

Hi Karen,

Can u tell me how to add a dropdown to my report ?

thanx

Magik

|||

Magic

do u wanna have a drop down list that has check boxes in it for multiple selections if so.. then

1) in your report parameter select the parameter that u want make as a dropdown and then select the multivalue check boxes...

2) if you want u can create a different dataset to popluate the drop down list and select query from the avaliable values.. and then select the dataset etc. and click ok.

3) in your stored procedure should like this...

Declare the @.Param as nvarchar(max)

@.sqltext nvarchar(max)

if the @.Param is NULL

Begin

select * from whatever and include the joins

Else

Begin

Select @.SqlText = 'Select * from tablename where Field or columnname in @.Param'

Exceute (@.sqltext)

End

Hope this helps,

Regards

Karen

sql

Is it possible to have a List box or a combo box instead of a Drop downlist

Hi

Is it possible to have a list box or a combo box for selecting parameters instead of having a drop down list...

and If yes how can i do it?

Regards

Karen

Where? No, in the Report Manager. Yes, in custom applications that use the report viewer controls.|||

using Report manager.. how can i use it in report viewer control... cause i am letting the users view the same reports using Report viewer.. can u please give me some links as to how to do it...

regards

Karen

|||

In the Report Viewer control you can hide the parameter area and replace it with your own. You may find the following article useful.

|||

Teo Lachev,

Thanks for ur answer... is it possible to do something like this in the stored procedure directly.. cause i am calling a stored procedure for that particular parameter and it list the all the plans in that drop down box...

My main Stored procedure to run the Report has 4 Parameter... and to populate one of the Parameters in the report i am using another sproc so that i can get all the plans... and if this is the case .... how do i get the values in a list...

Regards,

Karen

|||

So, once you decide to implement your own parameter area, it is up to you what controls to use or validation logic to implement to validate the parameter values. Essentially, you are building a custom WinForms or ASP.NET front end to handle parameters.

Is it possible to have a List box or a combo box instead of a Drop downlist

Hi

Is it possible to have a list box or a combo box for selecting parameters instead of having a drop down list...

and If yes how can i do it?

Regards

Karen

Where? No, in the Report Manager. Yes, in custom applications that use the report viewer controls.|||

using Report manager.. how can i use it in report viewer control... cause i am letting the users view the same reports using Report viewer.. can u please give me some links as to how to do it...

regards

Karen

|||

In the Report Viewer control you can hide the parameter area and replace it with your own. You may find the following article useful.

|||

Teo Lachev,

Thanks for ur answer... is it possible to do something like this in the stored procedure directly.. cause i am calling a stored procedure for that particular parameter and it list the all the plans in that drop down box...

My main Stored procedure to run the Report has 4 Parameter... and to populate one of the Parameters in the report i am using another sproc so that i can get all the plans... and if this is the case .... how do i get the values in a list...

Regards,

Karen

|||

So, once you decide to implement your own parameter area, it is up to you what controls to use or validation logic to implement to validate the parameter values. Essentially, you are building a custom WinForms or ASP.NET front end to handle parameters.

Friday, March 23, 2012

Is It possible to disable drop database for sa or sysadmin also ?

Hello,

I would like to know is it possible to disable drop database for sa
or sysadmin. If saor sysadmin needs to drop the database , he/she may
have to change status in one of the system tables (sysdatabases ?) and
then only database can be dropped . This is to avoid dropping the
database by mistake by sa.

In books online under drop database
System databases (msdb, master, model, tempdb) cannot be dropped

I would like to know how this is implemented for system databases ?

Thanks

M A Srinivas"M A Srinivas" <masri@.vsnl.com> wrote in message
news:f7e90f78.0308160008.176fc1bc@.posting.google.c om...
> Hello,
> I would like to know is it possible to disable drop database for sa
> or sysadmin. If saor sysadmin needs to drop the database , he/she may
> have to change status in one of the system tables (sysdatabases ?) and
> then only database can be dropped . This is to avoid dropping the
> database by mistake by sa.
> In books online under drop database
> System databases (msdb, master, model, tempdb) cannot be dropped
> I would like to know how this is implemented for system databases ?
> Thanks
> M A Srinivas

Basically, no, it's not possible. A sysadmin can do anything in SQL Server,
so the best approach is to limit sysadmin membership to DBAs only. As with
any system administrator, you have to trust them to do the job properly,
based on their training, experience etc.

I don't know the mechanism that prevents system databases being dropped (I'd
guess that there may be a check in the MSSQL engine that won't drop dbid <=
4 or something similar), but there is no flag or other mechanism to prevent
someone with DROP DATABASE authority dropping user databases.

Simon|||"Simon Hayes" <sql@.hayes.ch> wrote in message
news:3f3e0eb0$1_4@.news.bluewin.ch...
> Basically, no, it's not possible. A sysadmin can do anything in SQL
Server,
> so the best approach is to limit sysadmin membership to DBAs only. As with
> any system administrator, you have to trust them to do the job properly,
> based on their training, experience etc.
> I don't know the mechanism that prevents system databases being dropped
(I'd
> guess that there may be a check in the MSSQL engine that won't drop dbid
<=
> 4 or something similar), but there is no flag or other mechanism to
prevent
> someone with DROP DATABASE authority dropping user databases.

I'd also question the utility of it.

If you're afraid of an sa purposely trying to do damage, a drop database is
the least of your worries (note normally you can't do it in any case if the
DB is in use).

If you're afraid they might do it by accident, I'd have to ask what are they
doing that the likelihood is all that high?

> Simon|||I know that database can not be dropped while in use.
Sometimes while dropping a database through EM, sa may select the
wrong database to drop by mistake.
Restoring of database from back-up takes time (depends on the size)

M A Srinivas
"Greg D. Moore \(Strider\)" <mooregr@.greenms.com> wrote in message news:<1iq%a.106647$wk4.105134@.twister.nyroc.rr.com>...
> "Simon Hayes" <sql@.hayes.ch> wrote in message
> news:3f3e0eb0$1_4@.news.bluewin.ch...
> > Basically, no, it's not possible. A sysadmin can do anything in SQL
> Server,
> > so the best approach is to limit sysadmin membership to DBAs only. As with
> > any system administrator, you have to trust them to do the job properly,
> > based on their training, experience etc.
> > I don't know the mechanism that prevents system databases being dropped
> (I'd
> > guess that there may be a check in the MSSQL engine that won't drop dbid
> <=
> > 4 or something similar), but there is no flag or other mechanism to
> prevent
> > someone with DROP DATABASE authority dropping user databases.
> I'd also question the utility of it.
> If you're afraid of an sa purposely trying to do damage, a drop database is
> the least of your worries (note normally you can't do it in any case if the
> DB is in use).
> If you're afraid they might do it by accident, I'd have to ask what are they
> doing that the likelihood is all that high?
>
> > Simon

Monday, March 19, 2012

Is it possible to alter snapshot agent to not drop tables?

We've got transactional replication set up from 2000 to 05. Is there a
way to not let the snapshot agent to drop and recreate the destination
tables, but rather truncate them?
Thank you,
Igor
*** Sent via Developersdex http://www.codecomments.com ***
Have a look at the article properties (@.pre_creation_cmd ). By default it is
Drop, but it can be converted to delete or truncate (or none).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Right ON!
Thank you.
*** Sent via Developersdex http://www.codecomments.com ***

Monday, February 20, 2012

Is capturesql the only way to script a drop using smo?

Is capturesql the only way to script a drop using smo?

You can set the ScriptingOptions.ScriptDrops to true and then pass it to Script(ScriptingOptions). This will return you the script to drop the object.

Thanks,
Kuntal

|||Aha...thanks. I knew there had to be an easy way to do this!