|
Muntyness wrote: it throws me up an error message
What error message it return?
I Love SQL
|
|
|
|
|
Ahhh goddammint!
I figured out what the problem was.
I was using "SELECT * FROM IDs WHERE id='2'" when I should have been using "SELECT * FROM IDs WHERE id=2".
![Mad | :mad:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_mad.gif)
|
|
|
|
|
Have you tried:
"SELECT * FROM IDs WHERE id=2"
|
|
|
|
|
Hello All,
Need your help with regards to SSO(Single Sign On). Lets say I have two websites A and B. After user logs on to A(login.aspx) user needs to go a say a default.aspx page and on Default.aspx, there is a button which on click should send the user to website B,(both websites are on the same domain..lets say a.abc.com and b.abc.com) as user is already logged on site A..it should directly send the user to welcome.aspx page on site B. Iam using form authentication. This is what i have in my web.config on both sites.
<authentication mode="Forms">
<forms name=".SSOAUTH" loginUrl="Login.aspx" protection="All" path="/" timeout="30"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<machineKey validationKey="1234567890" decryptionKey="9876543243" validation="SHA1"/>
On my site A login page, when user enters a login and password, i call a function and go against my DB and validate, if login and pwd match db, i return customerid and the code is as below:
Dim customerid As String = ValidateUser(txtUserName.Value, txtUserPass.Value)
If customerid <> "0" Then '--------Comment-if login is fine, customerid is never 0
Dim tkt As FormsAuthenticationTicket
Dim cookiestr As String
Dim ck As HttpCookie
tkt = New FormsAuthenticationTicket(1, txtUserName.Value, DateTime.Now, DateTime.Now.AddMinutes(30), True, "your custom data")
cookiestr = FormsAuthentication.Encrypt(tkt)
Session("FormData") = cookiestr '------Comment-saving in session for later use
Dim b As String = FormsAuthentication.FormsCookieName
Response.Cookies(b).Domain = .abc.com
Response.Cookies(b)("SiteA") = cookiestr
Response.Cookies(b).Expires = tkt.Expiration
Response.Cookies(b).Path = FormsAuthentication.FormsCookiePath
Response.Redirect("default.aspx")
Dim strRedirect As String
strRedirect = Request("ReturnURL")
If strRedirect <> "" Then
Response.Redirect(strRedirect, True)
Else
strRedirect = "Default.aspx"
Response.Redirect(strRedirect, True)
End If
Else
Response.Redirect("Login.aspx", True)
End If
My problem is it never redirects to Default.aspx on Site A... and from default.aspx on Site A..if i click a button..i need to it go to welcome.aspx on site B... for some weird reason though, it goes back to the login page..and further.. the cookie is set..its not reading it on site B. Please Help !! Any help is appreciated, where am i going wrong? code samples are much appreciated.
RH
|
|
|
|
|
I'm looking the code or codes of parameters in Crystal Report that I can access using C #. I appreciate your help.
|
|
|
|
|
|
with 'OWC .NET testpages demo app' depending on the option I select in:
'OWC demoss:
Scatter chart demo
OWC chart types
OWC chart with trendline and errorbars
I get 'could not load type: main.aspx
owctypes.aspx
trend.aspx
any ideas?
john
|
|
|
|
|
Hi ,
I am trying 3rd party authentication in my web application.
I am trying to use Google, Yahoo, AOL authentication providers. These authentication processes I am using to authenticate my application. I've done authentication for GMAIL.
In this authentication I've done following steps
1.Registered in GMAIL and mentioned destination page for remote authentication.
2.Used URL of Gmail authentication in my code and redirected to it
3.After entering correct credentials I retrieve TOKEN
4.Extract this TOKEN in destination page which I've mentioned in 1st step and with that Token I am calling Web service of GMAIL and retrieve User Details form it and showing on that page.
It is working fine for GOOGLE but from nowhere I am getting process/steps of how to use third party authentication for OPENID.
Please tell me if you know how to authenticate it.
Abhishek J
|
|
|
|
|
Hi All
I have created a folder which I want to rename through coding. If some knows the procedure then pls help me.
thanks in Advance.
|
|
|
|
|
Use the System.IO.Directory.Move or the System.IO.DirectoryInfo.MoveTo method.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I think the possible way to rename the folder is to delete the folder and create the new folder with the new name, before deleting the old folder we should move he contents of that folder to new folder.
Regards,
Sandeep Kumar.V
|
|
|
|
|
System.IO.DirectoryInfo dInfo = new System.IO.DirectoryInfo(Server.MapPath("1"));<br />
if (dInfo.Exists)<br />
{<br />
System.IO.Directory.Move(Server.MapPath("1"), Server.MapPath("2"));<br />
}<br />
I just tried it.Its working fine
Here "1" is folder name
Best Regard
Khan
---------------------------------------------------
|
|
|
|
|
Thank u all of u, its realy helpfull. I have done my work. Once again thanks
|
|
|
|
|
Hello,
I’m writing a web application that needs to access other web applications. The pages that I need to access use both windows and forms authentication. I need to authenticate the users of my application without prompting for their password a username (they have a password and a username and I’ll use them to log in automatically).
I’ve already made this process for the applications that use forms authentication by making a POST request programmatically.
I need to do the same for the applications that I need to access that are using windows authentication, but I have no idea. Can anyone help me? Thanks.
|
|
|
|
|
how to create dynamic control in asp.net(on end user demand)
help me
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
You can place a content place holder and add controls into that depending on user choice. But you won't be able to make this very generic solution. You should have an idea on the type of controls what user will add
|
|
|
|
|
thanks for reply
first time i do this type of work so which way we arrange control on the page.and how we transfer the information and etc have u any link or example
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
Take Place Holder in page
Create object of control like as
-- TextBox txt1=new TextBox();<br />
---txt1.ID="txt1";
Add this control in placeHolder
<br />
-- PlaceHolder1.Controls.Add(txt1);
To use this control
use findcontrol method
--
string val=((TextBox)this.Page.FindControl("txt1")).Text;<br />
Best Regard
Khan
---------------------------------------------------
|
|
|
|
|
Hi,
I have used Class library using C# ASP.NET2005 and created a public-private key using Sn -k myfile.snk syntax.
I have signed in the key to the class library created and had builded it.
I have added the dll to the GAC using gacutil /i myclasslib.dll
The dll is successfully added to cache.
Now,
1.How to include the shared myclasslib.dll to my new asp.net c# application?
2.Does the myfile(strongname) created can be used for sharing more than one dlls?
3.If so then how can the stron name can uniquely identify the assembly?
4.Does the c# dll can be used in vb.net windows application?
Thanks,
zari
|
|
|
|
|
zareee wrote: 1.How to include the shared myclasslib.dll to my new asp.net c# application?
If your assembly is added to Global Assembly Cache, then you can add reference to it.
zareee wrote: 4.Does the c# dll can be used in vb.net windows application?
Yes you can use that. It will be in MSIL ( Microsoft Intermediate Language ) format. It doesn't care about C# or VB.NET.
|
|
|
|
|
In add reference i dont have the dll i created. But the dll is there in c:/winnt/assembly.
zari
|
|
|
|
|
Hi
I have got a datagrid which, has an asp:image tag embedded through the columns, i have it pulling in the image url from a database.
It does all this succesfully, but it jus won't render the images in the browser, it jus shows my alternative text.
Is there somthing i am not doing? do i have to write a method for rendering these, if so how would i go about it?
here is my code
any help would be great, cheers
Boyindie
<form id="form1" runat="server">
<div>
<asp:DataGrid runat=server ID=dgImage AllowPaging="True" AutoGenerateColumns="False" DataKeyField="imageId">
<Columns>
<asp:BoundColumn DataField=imageId HeaderText="Image ID" ></asp:BoundColumn>
<asp:TemplateColumn HeaderText=Products >
<ItemTemplate >
<asp:Image runat=server ID=imageHolder imageurl='<%#databinder.eval(container.dataitem,"imageAddress")%> ' Width=60 Height =80 BorderWidth =1 AlternateText='<%#databinder.eval(container.dataitem,"imageAddress")%> ' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn HeaderText="View item" CommandName=getDetails ButtonType=PushButton Text=Select></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</form>
</body>
'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Open connection to DB
connection.Open()
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection, so can pass SQL query
cmdString.Connection = connection
'Set command string to equal SPROC
cmdString.CommandText = "sp_image"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
'Create dataAdaptor for passing data between .net and mySQL
Dim dataAdaptor As New MySqlDataAdapter
'Sets command object to datAdaptor
dataAdaptor.SelectCommand = cmdString
'Creates a dataset which will be filled with data from
'dataAdaptor
Dim ds As New DataSet
dataAdaptor.Fill(ds)
'Creates Table which is filled data from dataset
Dim dataTable As New DataTable
dataTable = ds.Tables(0)
'Sets datagrids source to datatable
dgImage.DataSource = dataTable
'binds ds to datgrid
dgImage.DataBind()
|
|
|
|
|
hi all,
I got one reuirement that i need to compare two key's of hash table how can it possible,please try to help me out,
Thanks In Advance
Chadragupta
|
|
|
|
|
plz described in brief
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
The keys of a HashTable are stored as object, so you need to cast the keys to the actual type that you are using for key, before you can make a useful comparison between them.
If you are using framework 2, you should be using a Dictionary instead of a HashTable. Then the keys are not stored as object, so you don't have to cast them to use them.
---
single minded; short sighted; long gone;
|
|
|
|