Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
Old 04-09-2006, 03:33 AM I keep getting this!
Heba's Avatar
Average Talker

Posts: 28
Trades: 0
Hello
Am sure this is gonna turn out to have a silly mistake but I cant see it This form should insert the fields entered in a table but its not I keep getting this error when I start the paege too ... Can anyone see something I dont see
Error!

code!
Code:
<%@ Page Language="VB" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<%@ import Namespace="System.Web.UI.WebControls.Table" %>
<script runat="server">
    sub btnSave_Click(sender As Object, e As EventArgs)
        Dim strAssetType As string = lstAssetType.SelectedIndex
        Dim TrackStatus As string = rbtnAssetType.SelectedIndex
        Dim Quantity As string = txtQuantity.Text
        Dim Name As string = txtName.Text
        Dim Description As string = txtDesc.Text
        Dim Status As string = selectStatus.SelectedIndex
 
       If lstAssetType.SelectedIndex  = 0 and rbtnAssetType.SelectedIndex = 0 and txtQuantity.Text = "" _
        and txtName.Text = "" and txtDesc.Text = "" and selectStatus.SelectedIndex = 0 Then
        lblMessage.Text = "Please Complete the form."
       ElseIF lstAssetType.SelectedIndex  <> "0" and rbtnAssetType.SelectedIndex <> "0" and txtQuantity.Text <> "" _
        and txtName.Text <> "" and txtDesc.Text <> "" and selectStatus.SelectedIndex <> "0" Then
        InsertNewItems(strassetType, trackStatus , name ,  description ,status ,quantity)
        lblMessage.Text = "You have submitted your form successfully"
 
       End if
    End Sub
    Sub rbtnAssetType_SelectedIndexChanged(sender As Object, e As EventArgs)
    Quantity()
    End Sub
    Private Sub Quantity()
    if rbtnAssetType.SelectedIndex = 2 Then
    Dim tblSerial as new table
    tblSerial.Enabled = false
    End if
    End Sub
 
        Function InsertNewItems(ByVal strassetType As String, ByVal trackStatus As String, ByVal name As String, ByVal description As String, ByVal status As String, ByVal quantity As Integer) As Integer
            Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Documents an"& _
                "d Settings\kdb3684\Desktop\Warehouse_Services_Operations_System\HASEM.mdb"
            Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
            Dim queryString As String = "INSERT INTO [tblNewItems] ([AssetType], [TrackStatus], [SerialNo], [AssetTag], [N"& _
                "ame], [Description], [Status], [Quantity]) VALUES (@AssetType, @TrackStatus, @Se"& _
                "rialNo, @AssetTag, @Name, @Description, @Status, @Quantity)"
            Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
            dbCommand.CommandText = queryString
            dbCommand.Connection = dbConnection
            Dim dbParam_strassetType As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
            dbParam_strassetType.ParameterName = "@strAssetType"
            dbParam_strassetType.Value = strassetType
            dbParam_strassetType.DbType = System.Data.DbType.[String]
            dbCommand.Parameters.Add(dbParam_strassetType)
            Dim dbParam_trackStatus As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
            dbParam_trackStatus.ParameterName = "@TrackStatus"
            dbParam_trackStatus.Value = trackStatus
            dbParam_trackStatus.DbType = System.Data.DbType.[String]
            dbCommand.Parameters.Add(dbParam_trackStatus)
            Dim dbParam_name As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
            dbParam_name.ParameterName = "@Name"
            dbParam_name.Value = name
            dbParam_name.DbType = System.Data.DbType.[String]
            dbCommand.Parameters.Add(dbParam_name)
            Dim dbParam_description As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
            dbParam_description.ParameterName = "@Description"
            dbParam_description.Value = description
            dbParam_description.DbType = System.Data.DbType.[String]
            dbCommand.Parameters.Add(dbParam_description)
            Dim dbParam_status As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
            dbParam_status.ParameterName = "@Status"
            dbParam_status.Value = status
            dbParam_status.DbType = System.Data.DbType.[String]
            dbCommand.Parameters.Add(dbParam_status)
            Dim dbParam_quantity As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
            dbParam_quantity.ParameterName = "@Quantity"
            dbParam_quantity.Value = quantity
            dbParam_quantity.DbType = System.Data.DbType.Int32
            dbCommand.Parameters.Add(dbParam_quantity)
            Dim rowsAffected As Integer = 0
            dbConnection.Open
            Try
                rowsAffected = dbCommand.ExecuteNonQuery
            Finally
                dbConnection.Close
            End Try
            Return rowsAffected
        End Function
</script>
Line 62 is this
Code:
Dim dbParam_strassetType As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
Heba is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-09-2006, 04:20 AM Re: I keep getting this!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
because it's an error from IE, it's the rendered page where the error is NOT the server side code.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-09-2006, 07:19 AM Re: I keep getting this!
Heba's Avatar
Average Talker

Posts: 28
Trades: 0
i didnt understand ...

are you saying that its an error with the HTML code?
Heba is offline
Reply With Quote
View Public Profile
 
Old 04-09-2006, 11:18 AM Re: I keep getting this!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
well not the HTML as such, because as the error is caused by a missing ";" (semicolon) it will be in some javascript.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-11-2006, 02:08 AM Re: I keep getting this!
Heba's Avatar
Average Talker

Posts: 28
Trades: 0
yes solved it thanks
Heba is offline
Reply With Quote
View Public Profile
 
Old 05-17-2006, 01:17 AM Re: I keep getting this!
rajkiran's Avatar
Junior Talker

Posts: 2
Trades: 0
Good that you solved it, just one suggestion never use internet explorer to debug javascript use Mozilla Firefox. It has got a very good javascript console which will point the exact error and line number.
__________________
Thanks

Please login or register to view this content. Registration is FREE
rajkiran is offline
Reply With Quote
View Public Profile Visit rajkiran's homepage!
 
Old 05-17-2006, 01:32 AM Re: I keep getting this!
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,898
Name: Keith Marshall
Location: Connecticut
Trades: 0
I hate FF - but its great for the debugging stage!
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I keep getting this!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41501 seconds with 12 queries