|
I would like to ask user name and password when accessing to database with login prompt but seems that there doesn't exist the same mechanisn than eg. earlier VB connection object. (like connection.Properties("PROMPT") = adPromptComplete)
This kind of login form would be useful especially in situation when I get default connectionstring with Integrated Security=SSPI and that doesn't work...
C# connection object doesn't have properties property??
-- modified at 8:35 Wednesday 5th July, 2006
|
|
|
|
|
jaskatpl wrote: This kind of login form would be useful especially in situation when I get default connectionstring with Integrated Security=SSPI and that doesn't work...
This is not a "default" connection. It means you connect using the rights associated with the security context the calling application is running within. Typically, for a windows application, this will be the account you logged on with.
jaskatpl wrote: C# connection object doesn't have properties property??
C# is a language, the .NET Framework has a number of connection classes. I'm assuming you are referring to SqlConnection. You can set the connection string to contain a username and password if you want. All you have to do then is to create a dialog to accept a username and password and use that when you are building a connection string.
Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?
My: Website | Blog
|
|
|
|
|
Ok.. sorry about some inaccuraties but let's say that I have my default connnectionstring in my specific application. Now my "default" connectionstring have keyword Integrated Security with value SSPI and I test connection when I am contsructing object from my DataAccesLayer. The test fail and I want to use eg. sql server autentication with used id and password as "backdoor". There have been "automatic" mechanism for this earlier and now I'm wondering why it doesn't exist(or I simply could't find it)
Colin Angus Mackay wrote: All you have to do then is to create a dialog to accept a username and password and use that when you are building a connection string.
Yes.. exaclty. It's very easy but I still would like to find some other way ...
|
|
|
|
|
jaskatpl wrote: Now my "default" connectionstring have keyword Integrated Security with value SSPI and I test connection when I am contsructing object from my DataAccesLayer. The test fail and I want to use eg. sql server autentication with used id and password as "backdoor".
Then you need to supply different connection strings for different scenarios. "Backdoors" are a form of security violation and I trust that you didn't really mean "backdoor" in that sense. You can put the connection string in to the app.config and when you are running your application in side the test framework (I use NUnit) you can supply a different config file. For example, if you open a test assembly in NUnit it will pull in an app config file with called assemblyname.dll.config
jaskatpl wrote: There have been "automatic" mechanism for this earlier
There has, to my knowledge, never been an automatic mechanism for this.
Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?
My: Website | Blog
|
|
|
|
|
->backdoor
I'm not very familiar yet with these english terms so thanks for correcting.
I have always just one connectionstring that I read from .ini-file and I cannot
change that because there is many other applications that are using the same
value. Sometimes the windows autentication fails and that's why I need sometimes login prompt.
Colin Angus Mackay wrote: There has, to my knowledge, never been an automatic mechanism for this.
What I really mean is this:
http://support.microsoft.com/default.aspx/kb/200886[^]
Old ADO supports this but I haven't found it from ADO.NET...
-- modified at 2:00 Thursday 6th July, 2006
|
|
|
|
|
|
Colin Angus Mackay wrote: ADO.NET isn't a continuation of the old ADO. The only thing that is shared between the two is part of the name.
some people have an other opinion:
-> There are a number of similarities between ADO.NET programming
-> and ADO (not only the name), so upgrading from ADO shouldn't be too
-> difficult.
http://www.stardeveloper.com/articles/display.html?article=2002042001&page=1[^]
but ok, I don't want to argue with that. The result is that I have to code the login prompt myself.
|
|
|
|
|
|
Hi everyone....
Can anyone tell me if its possible to autosearch a datagrid if the user starts typing on it ?
For example if the user starts typing in a Code field, the datagrid must go to the first location equal to the character pressed etc. until a code is found. Keypressed property ?? Please need help !
|
|
|
|
|
Are you talking about a winform or asp.net app?
If it's winform, you should be able to subscribe to the keydown (or keyup) event. Look at the args to the event and then set the selected index in your grid to whatever row (and whatever column in the row you're talking about) matches the key.
If it's asp.net, you could hook up a javascript function and try to perhaps set a background color on one of the rows. But that will be quite difficult as you will have to interogate the generated table's cell values (innertext i think) and then set a background color on the row with the matching value.
Another way to go might be to put a text box up above the grid and a button beside it that says something like 'find'. Let them type a text fragment into the box and then use the button's event to search the grid contents.
|
|
|
|
|
Yes im talking about a windows form. I did the textbox and button thing but i want as less buttons as possible. Im trying the keydown event ... but having some trouble with it. The datagrid wants to refresh and get the data from the dataset again but i just want it to scroll down to the letter, letters or word ...
|
|
|
|
|
Probably not exactly what you are looking for but I wrote an article which filters the DataGrid. You can find it here[^].
|
|
|
|
|
Something like that , just without the testboxes and filter only by one field.
Thanks anyway
|
|
|
|
|
Hi, anyone know how to drag and drop pictures onto the picture box?
I wan to drag others different images onto 1 single image. it works just like neoprints thingy, dragging other decorative images to the picture that we took. Thanks.
|
|
|
|
|
Hello Friends,
I am facing some problem in Date Time in c#.
I wrote program like this
string strdt= "06/19/2006"; //mm/dd/yyyy
DateTime dt= Convert.ToDateTime(strdt).ToString("d") ;
When I execute this then I get value in dt like "6/19/2006"
But, Actually I need value in dt "06/19/2006" in this format. I mean to say Zero with Six.
How can I solve this problem?
Any help is appreciated
Thanks,
Rajesh
rajesh
|
|
|
|
|
See this:
Console.WriteLine(DateTime.Now.ToString("d", DateTimeFormatInfo.InvariantInfo));
|
|
|
|
|
If you look at the documentation it states that if the day is a single digit it will be returned as a single digit. I would think it doesn't matter how it is stored internally, but how it is displayed. If you want a day to be displayed with a leading zero, use "dd" in the format string.
Here is the link from the MS help files:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconcustomdatetimeformatstrings.htm
HTH
Gandalf
|
|
|
|
|
use
string[] str=dt.Date.GetDateTimeFormats('d');
Take whatever the format you want from str array
Srini
|
|
|
|
|
I think the ToShortDateString does it automatically.
DateTime date = Convert.ToDateTime(strdt).ToShortDateString();
|
|
|
|
|
DateTime dt = DateTime.Parse(strdt);
Console.WriteLine(dt.ToString("MM/dd/yyyy"));
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
Hi,
Here is the c#.Net code:
TcpClient client = new TcpClient();
client.Connect(clientMc , 9333);
NetworkStream ns = client.GetStream();
Note: clientMc is string storing remote machine name as specified in hostfile.
Problem: If clientMc is localhost, the client is getting connected.
If clientMc is the name of other remote machine, it is not connecting and it is waiting over there.
Could you please suggest me?
Thanks
chintu
-- modified at 8:19 Wednesday 5th July, 2006
|
|
|
|
|
Do you have something listening on that port on the other machine? Are you getting an exception?
|
|
|
|
|
|
How to store sessions in first page in asp.net
and then how to retrieve sessions in the next page.
pl explain with an example
Further what is the differece between :Request.QueryString and Request.Form.explain with an example
how & when to write a cookie? explain with an example
Thank U 4 ur kind support
Arun
-- modified at 6:39 Wednesday 5th July, 2006
|
|
|
|
|
Sounds like you should break out your text book, and see if you can get this information from there. That's why it's called homework.
|
|
|
|