|
Assuming you're using formsauthentication and not something homecooked:
FormsAuthentication.SignoutMy postings are a natural product. The slight variations in spelling and grammar enhance their individual character and beauty and are in no way to be considered flaws or defects.
|
|
|
|
|
For the login control that I am using, there is a connectionstring which is automatically created in the web.config file.
I ran an .exe file which populated the specified database with all the asp login related tables and stored procedures...
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=localmachineName;Initial Catalog=DBName;Persist Security Info=True;User ID=DBUserName;Password=password" providerName="System.Data.SqlClient"/>
</connectionStrings>
Question:
How can I point the login control to a different Database based on the database selection by a user i.e. the user can change the name of the database and so the login should point to that database.
Thanks
|
|
|
|
|
i have search form on asp dot net.
drop down list 1
drop down list 2
grid view control
selection in drop down list 1 populates ddl2 and after click on search button it searches fine.
but after search when i change ddl1, although it populates ddl2 accordingly but it also disturb gridview data. where as it should not disturb gridview because i only changes Drop down lists. grid's data should only be changed with Search button.
help plz
|
|
|
|
|
i think ajax will help you here
|
|
|
|
|
Use updatepanel and put your grid inside taht.Update the grid whenever required. Cheers!!
Brij
|
|
|
|
|
Hi,
I am getting this error There is an error in XML document (1, 2) When i Deserialize following Xml.
<EnvironmentConfigurations>
<EnvironmentConfiguration>
<EnvironmentName>ABC</EnvironmentName>
<CMSConfiguration>
<Address>net.tcp://localhost:9000/Manager</Address>
<Binding>netTcpBinding</Binding>
<Contract>Common.Interfaces.Server</Contract>
</CMSConfiguration>
</EnvironmentConfiguration>
<EnvironmentConfiguration>
<EnvironmentName>XYZ</EnvironmentName>
<CMSConfiguration>
<Address>net.tcp://localhost:9000/Manager</Address>
<Binding>netTcpBinding</Binding>
<Contract>Common.Interfaces.Server</Contract>
</CMSConfiguration>
</EnvironmentConfiguration>
</EnvironmentConfigurations>
|
|
|
|
|
use the code below..
System.Xml.Serialization.XmlRootAttribute xRoot = new System.Xml.Serialization.XmlRootAttribute();
xRoot.ElementName = "EnvironmentConfigurations";
xRoot.IsNullable = true;
System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(<your Type>), xRoot);
<your type> x = (<your Type>)ser.Deserialize(new System.IO.StringReader(<your xml>));
|
|
|
|
|
There are several connectionstrings in the web.cofig file.
<add name="DBConnection1" connectionString="Data Source=server1;Initial Catalog=database1;User Id=username;Password=password" providerName="System.Data.SqlClient"/>
<add name="DBConnection2" connectionString="Data Source=server1;Initial Catalog=database2;User Id=username;Password=password" providerName="System.Data.SqlClient"/>
...
...
I can retrieve each one of them by using the following code . i.e.
string strConn = ConfigurationManager.ConnectionStrings["DBConnection1"].ConnectionString;
Question:
How can I retrieve all the connectionstrings into one array of strings so that I can populate the names of the databases into a dropdown control? I ask because the list of the connectionstring in the web.config can grow. So I need a way to retrieve all the connectionstrings without hardcoding the connectionname as I have done above.
Any thoughts please?
Thanks
|
|
|
|
|
My first thought is load the web.config into and xmldocument and parse it yourself using SelectNodes.
|
|
|
|
|
Any other thoughts apart fro mxmldocument?
Thanks
|
|
|
|
|
<asp:DropDownList ID="ddl" runat="server"></asp:DropDownList>
ConnectionStringSettingsCollection a = ConfigurationManager.ConnectionStrings;
ListItem lst = new ListItem();
foreach (ConnectionStringSettings s in a)
{
lst = new ListItem(s.ConnectionString, s.ConnectionString);
ddl.Items.Add(lst);
}
ddl.Items.RemoveAt(0);
you can use any loop once it is populated in ConnectionStringSettingsCollection.
it populates one connection string from machine.config file. so i have removed 1st one.
Hope this will be helpful for u.
|
|
|
|
|
Hi,
In my Web Application I have my database on central server. There is one table A which is associated with 10-12 table. i.e. A tables primary key used as Foreign Key in other table. I used web service.
Now I have other application(Desktop Application) where I used web service. Now in that case I directly uses web service where in that I directly connect to the central database.
Now my problem is I have my 3rd application(Desktop application) where I dont want to connect directly to the central database. Means at first time its Ok to connect to the central database but for other manupulation it wont connect to the central database. I want to done it locally. Once all finish it will then update to the central database with all tables updated records.
Both 2nd and 3rd application run simultaneously. So because of local applications data is not updated 2nd application which is running will also provide the same primary key as local applications data once database manipulation done.
So if I integrate these database then it will overwrite the data or my 2nd applications data will lost.
I am using cache concept. But there is another problem of using caching if shut down the computer or power interrupt it will again lost the data.
So what can i do?
Thanks
Sjs
|
|
|
|
|
You can have two ID in Tables
1 is LocalID and another is CentralID
Might be the solution.Best Regards,
Chetan Patel
|
|
|
|
|
Thanks for the reply.
Now just I will explain what exactly problem is
My A table is very important. Now when my 2nd application run and when I login then automatically 1 entry is inserted into A table. Some work done on windows application and when going to next level it will again insert 1 entry to A table So if my A table start with 19th entry it will finish with 20th entry. There are some process in windows application where each time 1 entry inserted into A table. So near about 4-5 time each entry inserted.
Having Same application 3rd application running locally with same database manupulation. i.e. one entry inserted after login. so if after 2nd aplication login if my local 3rd application run and once user login then it will automatically generate next primary key i.e.20 at local machine which is already there on server database. And All my other forms which is depends on that primary key.
If I going to update server database with local entry then it will conflict.
Thanks
Sjs
|
|
|
|
|
Hi Everyone,
I am trying to create a simple customer object with firstname, lastname and dateofbirth
properties.
Then I would like to populate 4 of them or so and put them into a collection
and then populate them onto a page for display with a repeater control.
As I am not very expert in ASP.NET.
Please let me know your thoughts with sample code.
Thnaks
|
|
|
|
|
<asp:Repeater ID="Repeater1" runat="server" >
<HeaderTemplate >
<table width="100%">
<tr style="background-color:Black; color:White; font-weight:bold" >
<td >firstname</td>
<td >lastname</td>
<td >dateofbirth</td>
<td ></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td height="30px"><%#DataBinder.Eval(Container.DataItem,"firstname") %></td>
<td height="30px"><%#DataBinder.Eval(Container.DataItem,"lastname")%></td>
<td height="30px"><%#DataBinder.Eval(Container.DataItem,"dateofbirth")%></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
|
|
|
|
|
What have you tried so far? No one is just going to give you code.
Mod: okay, I was wrong: looks like someone did just give you some code. Must be your lucky day!.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
Hi,
I am beginner to ASP.Net.
I just learned Application[] class and session[] class. My question is which one is better? And where i have to use application[] object and where i have to use session[].
I have one more doubt:
I have two asp pages,
Page 1: take the choice from the user where i have three check boxes.
check 1. person names start with 's'
check 2. person names starts with 'a'
check 3. person name starts with 'g'.
So page one is contains above three check boxes. When user selects check box and submitted, it goes to second page where i have to write code for get the values from data base based on check boxes user selected.
For this kind of problem can i use Application[]. Or any other method to write solution for this.....
Thanks in advance .....To invent something, you need a mountain of junk in your mind.
---------------------Thomas alva edison
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">sampath-padamatinti wrote:</div>where i have to write code for get the values from data base based on check boxes</blockquote>
then Redirect to 2nd page use query string for id of check box...
get the values from db by using the id of check box from 1st page
|
|
|
|
|
Application is Shared among all the users so if you want to seperate the storage for each user use Session
Ex.// If you want to get Count of All Users then use Application
And if you have to store UserName then use SessionBest Regards,
Chetan Patel
|
|
|
|
|
you can use Session object to passing parameter among pages.
if you want to share this info for all users in your application, the Application is the choice.
|
|
|
|
|
Hello friends,
I want to develop the drag and drop functionality in my web application
I found better solution to implement using webparts. But i have one issues, the drag highlight style is not looking good while drag and drop from Zone1 to Zone2.
I want to change the drag highlight style.
How to change the drag highlight style while drag and drop
using webparts?
Thanks in Advance.damodharan
|
|
|
|
|
hi all
I have problem regarding Forms Authentication .
it's working fine in IE browser but it does not work in mozilla firefox ...
In IE, when i click on LOGOUT button, it does log out ..and when i click on "back" button of IE browser , it doesn't redirect back to logged in form .instead it remains on "login.aspx" page....this doesn't work in firefox.
what could be the error???..plz help
|
|
|
|
|
Did you think no one would notice you posting the same question as two different users? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
dude if u dnt know the answer then keep ur mouth shut
|
|
|
|