Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-05-2009
Members
 
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>
Reply With Quote
  #2  
Old 08-05-2009
Member
 
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
Reply With Quote
  #3  
Old 08-05-2009
Members
 
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.
Reply With Quote
  #4  
Old 08-05-2009
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Compiler Error Message BC30201 Expression expected"
Thread Thread Starter Forum Replies Last Post
Excel Error message: "External table is not in the expected format" X-quisite Windows Software 4 29-11-2010 10:59 AM
I get error message with G++ compiler but not with icc MKAIF Software Development 5 12-02-2010 04:33 PM
C-compiler gives "Abnormal program termination" error message Linoo Software Development 4 11-02-2010 08:36 PM
C compiler gives "error C2105: '++' needs l-value" message KALIDA Software Development 4 02-02-2010 05:02 PM


All times are GMT +5.5. The time now is 04:34 AM.