Monday, March 26, 2012
Proper Names function
GerryNo one?
DECLARE @.x varchar(8000)
SELECT @.x = 'FRED BLOGGS'
SELECT UPPER(SUBSTRING(@.x,1,1))
+ LOWER(SUBSTRING(@.x,2,CHARINDEX(' ',@.x)-1))
+ UPPER(SUBSTRING(@.x,CHARINDEX(' ',@.x)+1,1))
+ LOWER(SUBSTRING(@.x,CHARINDEX(' ',@.x)+2,LEN(@.x)-CHARINDEX(' ',@.x)+2))|||Thanks. I was hoping for a nice simple built in function but hey-ho :)|||OK
CREATE FUNCTION udf_ProperName(@.x varchar(8000))
RETURNS varchar(8000)
AS
BEGIN
RETURN UPPER(SUBSTRING(@.x,1,1))
+ LOWER(SUBSTRING(@.x,2,CHARINDEX(' ',@.x)-1))
+ UPPER(SUBSTRING(@.x,CHARINDEX(' ',@.x)+1,1))
+ LOWER(SUBSTRING(@.x,CHARINDEX(' ',@.x)+2,LEN(@.x)-CHARINDEX(' ',@.x)+2))
END
GO
SELECT dbo.udf_ProperName('FRED BLOGGS')
GO
DROP Function udf_ProperName
GOsql
Friday, March 23, 2012
Prompting connection str to access SQL server
my connection string is as per follows but how can i made it such that i
need not hard code the useid & pwd w/o having to create a user interface ?
tks & rdgs
Can you please send the connection string
best Regards,
Chandra
http://chanduas.blogspot.com/
"maxzsim" wrote:
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs
|||As far as I understand - you must use trusted connection option and depend
on account that your application work with.
Bojidar Alexandrov
"maxzsim" <maxzsim@.discussions.microsoft.com> wrote in message
news:DD415C15-32D4-43DC-B9AC-5C44D08DC738@.microsoft.com...
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs
|||That depends just on your application you code, there are serveral ways for
doing this:
Storing the password in a external storage (evtl. with encryption)
-registry
-xml file
-active directory
...
Using Windows Authentification:
http://msdn.microsoft.com/library/de...urity_47u6.asp
Using a DSN to connect with, (Has already a GUI ;-) )
But all that depends ont eh app you are coding the enviroment and so on..
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
"maxzsim" <maxzsim@.discussions.microsoft.com> schrieb im Newsbeitrag
news:DD415C15-32D4-43DC-B9AC-5C44D08DC738@.microsoft.com...
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs
Prompting connection str to access SQL server
my connection string is as per follows but how can i made it such that i
need not hard code the useid & pwd w/o having to create a user interface ?
tks & rdgsCan you please send the connection string
--
best Regards,
Chandra
http://chanduas.blogspot.com/
---
"maxzsim" wrote:
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs|||As far as I understand - you must use trusted connection option and depend
on account that your application work with.
Bojidar Alexandrov
"maxzsim" <maxzsim@.discussions.microsoft.com> wrote in message
news:DD415C15-32D4-43DC-B9AC-5C44D08DC738@.microsoft.com...
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs|||That depends just on your application you code, there are serveral ways for
doing this:
Storing the password in a external storage (evtl. with encryption)
-registry
-xml file
-active directory
..
Using Windows Authentification:
http://msdn.microsoft.com/library/d...>
ity_47u6.asp
Using a DSN to connect with, (Has already a GUI ;-) )
But all that depends ont eh app you are coding the enviroment and so on..
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"maxzsim" <maxzsim@.discussions.microsoft.com> schrieb im Newsbeitrag
news:DD415C15-32D4-43DC-B9AC-5C44D08DC738@.microsoft.com...
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs
Prompting connection str to access SQL server
my connection string is as per follows but how can i made it such that i
need not hard code the useid & pwd w/o having to create a user interface ?
tks & rdgsCan you please send the connection string
--
best Regards,
Chandra
http://chanduas.blogspot.com/
---
"maxzsim" wrote:
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs|||As far as I understand - you must use trusted connection option and depend
on account that your application work with.
Bojidar Alexandrov
"maxzsim" <maxzsim@.discussions.microsoft.com> wrote in message
news:DD415C15-32D4-43DC-B9AC-5C44D08DC738@.microsoft.com...
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgs|||That depends just on your application you code, there are serveral ways for
doing this:
Storing the password in a external storage (evtl. with encryption)
-registry
-xml file
-active directory
...
Using Windows Authentification:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_47u6.asp
Using a DSN to connect with, (Has already a GUI ;-) )
But all that depends ont eh app you are coding the enviroment and so on..
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"maxzsim" <maxzsim@.discussions.microsoft.com> schrieb im Newsbeitrag
news:DD415C15-32D4-43DC-B9AC-5C44D08DC738@.microsoft.com...
> Hi ,
> my connection string is as per follows but how can i made it such that i
> need not hard code the useid & pwd w/o having to create a user interface ?
> tks & rdgssql
Prompt for user credentials for database
Hello friends,
In my web application I have saved my connection string into web.config file. Now I have to send this web application to the client in the form of web set up. The issue is that on the client side, user credentials for the database will be different. So can we do some setings that the web application whenever will run should ask for the server name, username & Password. If this can be done then the application can be run anywhere considering all compatibilities.
Please let me know how this can be done.
Thanks & Regards
Girish Nehte
Hi,
We also encounter same issue...we have done following things...
we have stored IP,Database Name,userid and password ( separated by "," ) in notepad file and saved it at some common location.
and in applications we are referring this information to access database...
and we are telling client to put these details in file...so user can not make any other changes in web.config by mistake.
|||
Hi there,
Maybe I didn't understand well what's your problem, but it seems quite simple to me.
You only have one connection string (or user of the database). Then you have, for example, a table with many usernames/passwords you like.
When your client uses the applicaction, you ask for credentials right? Then you use your connection string, to check if its credentials match with any stored on the passwords table! If so you allow him to continue. If not, you don't allow the client to continue.
Hope it helped out :) And its safer than having it written on a text file!
gonzzas
Wednesday, March 7, 2012
Programmatically Adding ADO.NET Connections
I am displaying a report in a viewer. It is connected to a wrapper DLL through an ADO.NET connection using the properties:
File Path
Class Name
Dataset Names
I'm having trouble accessing these to change them at runtime.
I've tried something like:
rpt.database:Tables(1):ConnectionProperties("File Path") = "c:\..."
No luck. Crystal doesn't have much documentation on this method. Any takers?Nevermind. Got it.
I was able to override the path of my DLL at runtime using the syntax:
report.database.tables(1).ConnectionProperties("File Path").Value = "c:\blah"
seems to be working.