Results 1 to 4 of 4

Thread: Compiler Error Message BC30201 Expression expected

  1. #1
    Join Date
    Apr 2009
    Posts
    47

    Compiler Error Message BC30201 Expression expected

    Hi friends,

    I have created a code in Asp.net whenever i try to run the code i am getting the following message as

    • Error Message BC30201 Expression expected


    Here is the code in which i am getting the error message


    HTML Code:
    <%@ Import Namespace="System.data.Oledb" %>
    <html>
    <head>
    <title>Welcome to the WebStore</title>
    <style>
    BODY { SCROLLBAR-FACE-COLOR: #339900; SCROLLBAR-ARROW-COLOR: #FFFFFF; SCROLLBAR-TRACK-COLOR: #99CC00; }
    </style>
    <script runat="Server">
    
    Sub Submit_Click(s As Object, e As EventArgs)
     If IsValid Then
      If (Authenticate(Username.Text, Password.Text) > 0) Then
       FormsAuthentication.RedirectFromLoginPage(Username.Text, False)
      End If
     End If
    End Sub
    
    Function Authenticate(strUsername as string, strPassword as string) As Integer
    Dim objConn As OledbConnection
    Dim objCmd As OledbCommand
    Dim dbReader As OledbDataReader
    Dim intResult As Integer
    objConn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Intetpub\wwwroot\WebStoreASPNET\Database\Webstore.mdb")
    objCmd= New OledbCommand("Select Username, Password From Customers", ObjConn)
    
    ObjConn.Open()
    dbReader = objCmd.ExecuteReader()
    While dbReader.Read()
    If(strUsername=dbReader("Username") And
    strPassword=dbReader("Password")) Then
    intResult=1
    Return intResult
    Else
    intResult=0
    Return intresult
    End If
    End While
    dbreader.Close()
    objConn.Close()
    End Function
    </script>
    <link href="styles.css" rel="stylesheet" type="text/css">
    </head>
    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="100%" height="154" border="0" cellspacing="0" cellpadding="0" background="Images/header_bg.gif">
     <tr>
      <td>
       <table width="370" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td width="135" height="154"><img src="Images/header_main_left.gif" width="135" height="154"></td>
        <td width="235" height="154"><img src="Images/header_main_right.gif" width="235" height="154"></td>
        </tr>
       </table>
      </td>
     </tr>
    </table>
    <table width="760" border="0" cellspacing="0" cellpadding="0">
     <tr>
      
        <td width="135" rowspan="2" valign="top"> <br> </td>
      <td width="653" height="10" valign="top">
            <div align="right"> </div>
          </td>
     </tr>
     <tr>
        <td width="653" valign="top">
          <span class="body">Login</span>
          <br>
          <br>
          <form runat="server">
            <table width="208" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="99" class="body">Username:</td>
                <td width="96"><asp:textbox id="username" CssClass="textbox" runat="server" /></td>
              </tr>
              <tr>
                <td width="99" class="body">Password:</td>
                <td><asp:textbox id="password"  TextMode="Password" CssClass="textbox" runat="server" /></td>
              </tr>
              <tr>
                <td width="99">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td width="99">&nbsp;</td>
                <td>
                  <asp:button id="btnSubmit" Text="Login" onClick="Submit_Click" CssClass="textbox" runat="server" />
                </td>
              </tr>
            </table>
          </form>
          <p class="body"><a href="register.aspx">New User</a></p>      </td>
     </tr>
    </table>
    </body>
    </html>

  2. #2
    Join Date
    Dec 2008
    Posts
    164

    Re: Compiler Error Message BC30201 Expression expected

    Does you code is or you haven't copied it properly.

    HTML Code:
    If(strUsername=dbReader("Username") And 
    strPassword=dbReader("Password")) Then

  3. #3
    Join Date
    Apr 2009
    Posts
    47

    Re: Compiler Error Message BC30201 Expression expected

    No i have copied the code properly in my Coding i have mention it in the same way.

  4. #4
    Join Date
    Dec 2008
    Posts
    164

    Re: Compiler Error Message BC30201 Expression expected

    You are getting the error message because the code is in Visual basic and whenever there is any continuous in the code it has to written as

    If(strUsername=dbReader("Username") And _
    strPassword=dbReader("Password")) Then

Similar Threads

  1. Replies: 4
    Last Post: 29-11-2010, 10:59 AM
  2. I get error message with G++ compiler but not with icc
    By MKAIF in forum Software Development
    Replies: 5
    Last Post: 12-02-2010, 04:33 PM
  3. C-compiler gives "Abnormal program termination" error message
    By Linoo in forum Software Development
    Replies: 4
    Last Post: 11-02-2010, 08:36 PM
  4. C compiler gives "error C2105: '++' needs l-value" message
    By KALIDA in forum Software Development
    Replies: 4
    Last Post: 02-02-2010, 05:02 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,240,719.80327 seconds with 17 queries