Jump to content
Xtreme .Net Talk

farid

Members
  • Posts

    9
  • Joined

  • Last visited

farid's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. farid

    User IP

    thanks
  2. farid

    User IP

    User IP address not user Id
  3. farid

    User IP

    I need to use a hidden from field, can I use this code ??????
  4. farid

    User IP

    How can I get user id when he submit a from ?? Can any one tell me how ?????????????
  5. farid

    Sql Error

    And now I got this error Login failed for user 'ASPNET'. Invalid connection string attribute Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'ASPNET'. Invalid connection string attribute why ???????????????????????
  6. farid

    Sql Error

    user music exits and he is a music "database" db_owner
  7. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30002: Type 'OdbcConnection' is not defined. <%@ Page LANGUAGE="VB"%> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.ODBC" %> <SCRIPT LANGUAGE="VB" RUNAT="server"> Sub Page_Load(Sender As Object, E As EventArgs) Dim oConn As OdbcConnection Dim sConnString As String sConnString = "DNS=band" oConn = New OdbcConnection(sConnString) oConn.Open() oConn.Close() End Sub </SCRIPT> <HTML> <BODY> Opening a Connection with ODBC! </BODY> </HTML> there is a ODBC connectoion named band......... can any on help
  8. farid

    Sql Error

    every time I try to connect to Sql server I got this error Login failed for user 'music'. Reason: Not associated with a trusted SQL Server connection. Invalid connection string attribute or any user fail even "sa" Page Code <%@ Page LANGUAGE="VB"%> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDB" %> <SCRIPT LANGUAGE="VB" RUNAT="server"> Sub Page_Load(Sender As Object, E As EventArgs) Dim oConn As OleDBConnection Dim sConnString As String sConnString = "Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Music;UserID=music;Password=music" oConn = New OleDBConnection(sConnString) oConn.Open() oConn.Close() End Sub </SCRIPT> <HTML> <BODY> Opening a Connection! </BODY> </HTML> Can any one help
  9. I am trying to test form authentication in asp.net using xml file but I got this error "Syntax error: Missing operand after '@farid' operator. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SyntaxErrorException: Syntax error: Missing operand after '@farid' operator. Source Error: Line 36: Users = ds.tables(0) Line 37: Dim Matches() as DataRow Line 38: Matches = Users.Select(cmd) Line 39: If Matches.length >0 Then Line 40: Dim row as DataRow Source File: c:\inetpub\wwwroot\asp\login.aspx Line: 38 " the login.aspx page code <%@ Import Namespace="System.XML" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Web.Security" %> <%@ Import Namespace="System.Data.SqlClient" %> <%@ Import Namespace="System.Data.OleDB" %> <%@ Import Namespace="System.Data" %> <%@ Page Language="vb" debug="True"%> <HTML> <HEAD> <TITLE>Session 13 Cookie Authentication </TITLE> <SCRIPT LANGUAGE="VB" RUNAT="Server"> Sub btnLogin_Click(ByVal Sender As Object, ByVal E As EventArgs) Select Case ValidateUserXML(txtusername.text,txtpassword.text) Case "Success" FormsAuthentication.RedirectFromLoginPage (txtusername.text,chkPersistForms.Checked) Case "PasswordFailed" lblMessage.Text = "Sorry your password verification for the user " & txtusername.text &" failed." Case "NoSuchUser" Response.Redirect("adduser/adduser.aspx?username=" & txtusername.text) End Select End Sub Sub btnAddNewUser_Click(ByVal Sender As Object, ByVal E As EventArgs) Response.Redirect("adduser/adduser.aspx?username=Enter User Name") End Sub Function ValidateUserXML(ByVal username as String, ByVal password as String) as String Dim cmd as String cmd = "UserEmail=�" & username & "�" Dim ds as New DataSet Dim fs as new FileStream(Server.MapPath("users.xml"),FileMode.Open,FileAccess.Read) Dim reader as new StreamReader(fs) Dim pass as string Dim user as string ds.ReadXml(reader) fs.Close() Dim users as DataTable Users = ds.tables(0) Dim Matches() as DataRow Matches = Users.Select(cmd) If Matches.length >0 Then Dim row as DataRow row = matches(0) pass = row.item("UserPassword") user = row.item("userEmail") if pass = password then Return "Success" else Return "PasswordFailed" end if Else Return "NoSuchUser" End If End Function </SCRIPT> </HEAD> <BODY> <FORM ID="WebForm1" METHOD="postPOST" RUNAT="server"> <P> <STRONG>Session 13 Forms Authentication</STRONG> </P> <P> Please enter your username and password information below and then select the Login Button. </P> <P> <ASP:LABEL ID="lblMessage" RUNAT="SERVER"></ASP:LABEL> </P> <P> Email <ASP:TEXTBOX ID="txtUserName" RUNAT="SERVER" TOOLTIP="Please enter your Username here"></ASP:TEXTBOX> </P> <P> Password <ASP:TEXTBOX ID="txtPassword" RUNAT="SERVER" TEXTMODE="Password" TOOLTIP="Please enter your password here."></ASP:TEXTBOX> </P> <P> <ASP:CHECKBOX ID="chkPersistForms" RUNAT="SERVER" TEXT="Select to Persist Cookies"></ASP:CHECKBOX> </P> <P> <ASP:BUTTON ID="btnLogin" RUNAT="SERVER" TEXT="Login" ONCLICK="btnLogin_Click"></ASP:BUTTON> <ASP:BUTTON ID="btnAddUser" RUNAT="SERVER" TEXT="Add New User" ONCLICK="btnAddNewUser_Click"></ASP:BUTTON> </P> </FORM> </BODY> </HTML> the user.xml " <?xml version="1.0" encoding="iso-8859-1"?> <Users> <User> <UserEmail>joe@smith.com</UserEmail> <UserPassword>jsmith</UserPassword> </User> <User> <UserEmail>farid@farid.com</UserEmail> <UserPassword>farid</UserPassword> </User> </Users> " the config file "<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.Web> <authentication mode="Forms"> <forms name="CookieFormApplication" loginUrl="login.aspx" /> </authentication> <authorization> <deny users="?" /> </authorization> <sessionState mode="InProc" cookieless="false" timeout="20"/> </system.Web> </configuration>" can anyone help ?????????
×
×
  • Create New...