Showing posts with label users. Show all posts
Showing posts with label users. Show all posts

Sunday, March 25, 2012

Changing chart type at run-time

Hello,

I'm coding a web application using ASP.NET 2.0 and I'd like to show users some charts allowing them to chose the chart type at run-time.
I'm building a rdlc (local) report source at run-time starting from a template and working in memory.
Users can select wich rows and columns from a table to display in the chart. They can also chose che chart type (Bar, line, pie etc.)

Now the code works fine the first time it's run. Then the report viewer keeps showing the chart with the same chart type and columns data. Only rows change accordingly to the user selection.

I'm using the following code to initialize the reportviewer:

Dim str As System.IO.MemoryStream = New MemoryStream
rptDoc.Save(str) //->that's the xml doc being saved to a memory stream
str.Position = 0
repView.LocalReport.ReportPath = String.Empty 'Just in case...
repView.LocalReport.LoadReportDefinition(str)
repView.LocalReport.DataSources.Clear() 'Just in case again...
repView.LocalReport.DataSources.Add(New ReportDataSource("DataSet1_01E01000", dt2))
repView.LocalReport.Refresh()

Any suggestion?

Thank you all.Can you share with me how you change the Chart Type at Runtime? Thanks!|||

Sorry for the late reply, I haven't checked forums lately.

As I said I'm building the rdlc (local) report source file at run-time starting from some templates.

The rdlc files are nothing more that XML files and the chart type is defined inside a node. All I do is put the desired type in the right node.

You can also build a rdlc right from scratch and pass it to the ReportViewer component via its LoadReportDefinition method using the overloaded version that gets a IO.Stream as source.

Ask me if you need a sample.

Bye.

|||

You need to reset the report by doing a

ReportViewer1.Reset();//Then setting the datasource and all the properties.
|||

Hello Stojilcoviz,

Can you share with me the sample of your code which changes the chart types at run-time in the RDLC? Thanks.

Sunday, March 11, 2012

change user login at runtime

Hi, some one help me with this please
Our application is developed in Dot Net with Sql Server 2000 as a back
end.We have created users in our application (Dot Net) that will be
physically created in the back-end in the DB to which we will be connected
other than SA. These users will be authenticated by an administrator user to
login first time. After logging the application a tree menu appears to which
the forms and reports are attached . We are trying to implement a scenario
that the user will be given privileges of select , update, insert, delete on
the forms when they will double click it and open them. After closing the
form the privileges will be revoked from the user on the certain tables
associated with that form.
Now we cannot understand which user will be giving those privileges to the
connected user as we dont want to use SA. As this could become a problem at
the deployment time as we do not want to hard code the "SA" user. I have
seen "CONNECT To" statement that could change the login at runtime but it is
not running with these commands
EXEC SQL CONNECT TO :svr USER :usr;
Or
EXEC SQL CONNECT TO "gizmo.pubs" USER "sa";
Or
EXEC SQL CONNECT TO gizmo.pubs USER sa;
RegardsHi Shahzad:
I think you can use the connectstring to applied this.
You can change the connect string by the value you get from the asp and
change the connectstring and then connect to the sql server, I think it is
not very complexity.
Best Wishes
Wei Ci Zhou

change user login at runtime

Hi, some one help me with this please
Our application is developed in Dot Net with Sql Server 2000 as a back
end.We have created users in our application (Dot Net) that will be
physically created in the back-end in the DB to which we will be connected
other than SA. These users will be authenticated by an administrator user to
login first time. After logging the application a tree menu appears to which
the forms and reports are attached . We are trying to implement a scenario
that the user will be given privileges of select , update, insert, delete on
the forms when they will double click it and open them. After closing the
form the privileges will be revoked from the user on the certain tables
associated with that form.
Now we cannot understand which user will be giving those privileges to the
connected user as we dont want to use SA. As this could become a problem at
the deployment time as we do not want to hard code the "SA" user. I have
seen "CONNECT To" statement that could change the login at runtime but it is
not running with these commands
EXEC SQL CONNECT TO :svr USER :usr;
Or
EXEC SQL CONNECT TO "gizmo.pubs" USER "sa";
Or
EXEC SQL CONNECT TO gizmo.pubs USER sa;
RegardsHi Shahzad:
I think you can use the connectstring to applied this.
You can change the connect string by the value you get from the asp and
change the connectstring and then connect to the sql server, I think it is
not very complexity.
Best Wishes
Wei Ci Zhou

Change user login

A users name has changed. In active directory the account has been renamed.
How do you associate this renamed NT account with the SQL login? The orgina
l
SID still exists so I cant add the new NT user name. Can I modify the
sysxuser table? : (Doug:
You can remove a login from the server, but leave the user with rights to
each database. Then, when you add the login again with the new name and gran
t
them access to specific databases, you can map that new Domain name to the
old user in the database.
For example: MyDomain\Bob is a login to the server and a user of the
database. I remove MyDomain\Bob as a login (leaving him as a user in the db)
.
Then I add MyDomain\Robert as a login to the server. When I assign him acces
s
as a user to the database, I map him to MyDomain\Bob.
It's not elegant, but it might work (no guarantees!)
Good luck.
Todd C
"doug" wrote:

> A users name has changed. In active directory the account has been rename
d.
> How do you associate this renamed NT account with the SQL login? The orgi
nal
> SID still exists so I cant add the new NT user name. Can I modify the
> sysxuser table? : (

Wednesday, March 7, 2012

Change the default database

This is a SQL Server 2000 database with several databases
with Windows groups and users.
If a user is in a Windows group how can the user change
his or her default database without changing the Window
group default database?
Thank You,
Mark
I haven't tried it, but I'm not sure you can use EXEC sp_defaultdb
'domain\username', 'dbname' unless the user is explicitly listed as a login
in SQL Server.
http://www.aspfaq.com/
(Reverse address to reply.)
"Mark" <anonymous@.discussions.microsoft.com> wrote in message
news:01d801c4acaa$76d19140$a501280a@.phx.gbl...
> This is a SQL Server 2000 database with several databases
> with Windows groups and users.
> If a user is in a Windows group how can the user change
> his or her default database without changing the Window
> group default database?
> Thank You,
> Mark
|||Each user will have to run sp_defaultdb 'ntdomain\ntloginname' ,
'defaultdatabse' from a QA window.
- Bhanu.
"Mark" <anonymous@.discussions.microsoft.com> wrote in message
news:01d801c4acaa$76d19140$a501280a@.phx.gbl...
> This is a SQL Server 2000 database with several databases
> with Windows groups and users.
> If a user is in a Windows group how can the user change
> his or her default database without changing the Window
> group default database?
> Thank You,
> Mark

Change the default database

This is a SQL Server 2000 database with several databases
with Windows groups and users.
If a user is in a Windows group how can the user change
his or her default database without changing the Window
group default database?
Thank You,
MarkI haven't tried it, but I'm not sure you can use EXEC sp_defaultdb
'domain\username', 'dbname' unless the user is explicitly listed as a login
in SQL Server.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Mark" <anonymous@.discussions.microsoft.com> wrote in message
news:01d801c4acaa$76d19140$a501280a@.phx.gbl...
> This is a SQL Server 2000 database with several databases
> with Windows groups and users.
> If a user is in a Windows group how can the user change
> his or her default database without changing the Window
> group default database?
> Thank You,
> Mark|||Each user will have to run sp_defaultdb 'ntdomain\ntloginname' ,
'defaultdatabse' from a QA window.
- Bhanu.
"Mark" <anonymous@.discussions.microsoft.com> wrote in message
news:01d801c4acaa$76d19140$a501280a@.phx.gbl...
> This is a SQL Server 2000 database with several databases
> with Windows groups and users.
> If a user is in a Windows group how can the user change
> his or her default database without changing the Window
> group default database?
> Thank You,
> Mark

Saturday, February 25, 2012

change style comparison for user DB

Hi,
I have 2 SQL Server 7.0 and they are similar except
for style comparison. I reinstall one server and when try
to attach users db to new server from a backup, an error
occurs like this "style comparison for DB XXXX
are '196609' and server uses '196611'".
Anybody know that how can i do to change style comparison
for DB without affecting master db? can i do this?
tks.
DBA Beginner.If the servers can see each other why not transfer all objects using DTS to
circumvent this problem
--
HTH
Ryan Waight, MCDBA, MCSE
"vladimir" <vladimir.gutierrez@.molymet.cl> wrote in message
news:2a7d901c39262$547a0900$a601280a@.phx.gbl...
> Hi,
> I have 2 SQL Server 7.0 and they are similar except
> for style comparison. I reinstall one server and when try
> to attach users db to new server from a backup, an error
> occurs like this "style comparison for DB XXXX
> are '196609' and server uses '196611'".
> Anybody know that how can i do to change style comparison
> for DB without affecting master db? can i do this?
> tks.
> DBA Beginner.
>|||because original server was reinstalled and have no choice
to mount this databases due to error.
it is possible change style comparison from a backup? , i
have an off-line data file copy too. can i do something?.
Rgds.
>--Original Message--
>If the servers can see each other why not transfer all
objects using DTS to
>circumvent this problem
>--
>HTH
>Ryan Waight, MCDBA, MCSE
>"vladimir" <vladimir.gutierrez@.molymet.cl> wrote in
message
>news:2a7d901c39262$547a0900$a601280a@.phx.gbl...
>> Hi,
>> I have 2 SQL Server 7.0 and they are similar except
>> for style comparison. I reinstall one server and when
try
>> to attach users db to new server from a backup, an error
>> occurs like this "style comparison for DB XXXX
>> are '196609' and server uses '196611'".
>> Anybody know that how can i do to change style
comparison
>> for DB without affecting master db? can i do this?
>> tks.
>> DBA Beginner.
>
>.
>|||> it is possible change style comparison from a backup?
No.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"vladimir" <vladimir.gutierrez@.molymet.cl> wrote in message
news:0a3d01c3927e$f3b732b0$a001280a@.phx.gbl...
> because original server was reinstalled and have no choice
> to mount this databases due to error.
> it is possible change style comparison from a backup? , i
> have an off-line data file copy too. can i do something?.
> Rgds.
> >--Original Message--
> >If the servers can see each other why not transfer all
> objects using DTS to
> >circumvent this problem
> >
> >--
> >HTH
> >Ryan Waight, MCDBA, MCSE
> >
> >"vladimir" <vladimir.gutierrez@.molymet.cl> wrote in
> message
> >news:2a7d901c39262$547a0900$a601280a@.phx.gbl...
> >> Hi,
> >>
> >> I have 2 SQL Server 7.0 and they are similar except
> >> for style comparison. I reinstall one server and when
> try
> >> to attach users db to new server from a backup, an error
> >> occurs like this "style comparison for DB XXXX
> >> are '196609' and server uses '196611'".
> >>
> >> Anybody know that how can i do to change style
> comparison
> >> for DB without affecting master db? can i do this?
> >>
> >> tks.
> >> DBA Beginner.
> >>
> >
> >
> >.
> >

Friday, February 24, 2012

Change SQL Server account password

I am looking for an *easy* way to allow *non-technical* end users to
change their SQL Server account password. Does anyone have any
suggestions? I am not a programmer by trade, but I can write scripts.
It would be great if I could do this for my Oracle databases, too.
Thanks,
Aaron
How do your users connect? Through some sort of application?
It would be pretty simple to have an application wrapper around sp_password.
Of course, if they are using Query Analyzer and know how to submit thier own
queries... I don't think it's much of a burden to show people the syntax for
sp_password and let them run it on thier own.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Vols Fan" <volsfan1998@.hotmail.com> wrote in message
news:2489efb1.0408181426.14242c24@.posting.google.c om...
> I am looking for an *easy* way to allow *non-technical* end users to
> change their SQL Server account password. Does anyone have any
> suggestions? I am not a programmer by trade, but I can write scripts.
> It would be great if I could do this for my Oracle databases, too.
> Thanks,
> Aaron
|||Anyone have a little application that can do this?
I have the same exact question. The apps I am using are vendor written, so I don't have access to the code.|||I'm looking for this answer too. Did you come up with anything? I need an easy way for users to change their SQL account passwords.

Tuesday, February 14, 2012

Change password to sa user from remote client

Hello,
We need to change passwords to sa users from remote clients. The
problem is of course that we need to encrypt the password.
What is the best way to do this?
We read about applying a secure connection with sql server using SSL,
IPSec, multiprotocol. We implement them but we would like to know if
there is a way (maybe an api) that allow to change passwords and
encrypt them.
Yaron Paryanty
Cyber Ark CompanyI hope your asking about encrypting a session, and not using 'sa' for your
application...
By default if there is a Server certificate installed on SQL, we do encrypt
the logins on the wire. To be more secure you can Force Protocol
encryption on the client, which will encrypt all the traffic on the wire.
276553 HOW TO: Enable SSL Encryption for SQL Server 2000 with Certificate
Server
http://support.microsoft.com/?id=276553
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||First of all thank you for your answer.
I am asking about encrypting the session but after i logon to the
mssql server i want to alter the password of sa user (or any other
user). If i sent the new password as is it will send by plained text.
I implement SSL and it works fine but i wanted to know if there is
something easier - like an API which change the password and send it
encrypted.
Thanks,
Yaron Paryanty
Cyber-Ark|||Protocol encryption is the way to do this safely. We' re able to encrypt
over all the protocols in SQL 2000. In previous versions we could only
encrypt the data using Multiprotocol.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Friday, February 10, 2012

Change Login-Info for Activity-Monitor and sp_who

Hi

we have one 'application'-user in sysusers that makes the connect to SqlServer for all users, for example:

Application Login-User: Thomas

DB-Connect-User: AppUser

With this solution, in Activity-Monitor or with sp_who I don't know, what is the real name of the connected user.

Any possibility to change the login-information after the connect, so that i can see 'Thomas' in Activity-Monitor or with sp_who?

Thanks for your help.

Thomas

You will see only Thomas and AppUser that are used by web server to connect to server and use objects of db.

I think in your db there is a table that contain users with encrypted passwords and if you want to see who access your application when the user app try to connect with or without succes , using sp that making the verification you can put somehere in a table the information that the user is connected. Querying that table you can see who is connected.

|||

Since Login to User is 1 to M , you will not get the result as you mentioned in either SP_Who or Activity monitor. You can make a customized sp from sp_who and you can use that. Just you need to join with sys.database_principals

(a) SP_Helptext sp_Who -- Will give u the source code of sp_who

(b) Join with sys.database_principals .

the following script is taken from sp_who and then joined with sys.database_principals . sys.database_principals is database specific. So you should run this script in the particular database to get the desired result.

select spid , ecid, status

,loginame=rtrim(loginame)

,hostname ,blk=convert(char(5),blocked)

,dbname = case

when dbid = 0 then null

when dbid <> 0 then db_name(dbid)

end

,cmd

,request_id ,sdp.Name as UserName

from master.dbo.sysprocesses inner join

sys.database_principals sdp on sdp.sid=master.dbo.sysprocesses .sid

Madhu

Change Login-Info for Activity-Monitor and sp_who

Hi

we have one 'application'-user in sysusers that makes the connect to SqlServer for all users, for example:

Application Login-User: Thomas

DB-Connect-User: AppUser

With this solution, in Activity-Monitor or with sp_who I don't know, what is the real name of the connected user.

Any possibility to change the login-information after the connect, so that i can see 'Thomas' in Activity-Monitor or with sp_who?

Thanks for your help.

Thomas

You will see only Thomas and AppUser that are used by web server to connect to server and use objects of db.

I think in your db there is a table that contain users with encrypted passwords and if you want to see who access your application when the user app try to connect with or without succes , using sp that making the verification you can put somehere in a table the information that the user is connected. Querying that table you can see who is connected.

|||

Since Login to User is 1 to M , you will not get the result as you mentioned in either SP_Who or Activity monitor. You can make a customized sp from sp_who and you can use that. Just you need to join with sys.database_principals

(a) SP_Helptext sp_Who -- Will give u the source code of sp_who

(b) Join with sys.database_principals .

the following script is taken from sp_who and then joined with sys.database_principals . sys.database_principals is database specific. So you should run this script in the particular database to get the desired result.

select spid , ecid, status

,loginame=rtrim(loginame)

,hostname ,blk=convert(char(5),blocked)

,dbname = case

when dbid = 0 then null

when dbid <> 0 then db_name(dbid)

end

,cmd

,request_id ,sdp.Name as UserName

from master.dbo.sysprocesses inner join

sys.database_principals sdp on sdp.sid=master.dbo.sysprocesses .sid

Madhu