freelanceprogrammers.org Forum Index » ASP
Re: Form wil not submit. UPDATE
Joined: 03 Jan 2005
Posts: 15
Re: Form wil not submit. UPDATE
>I commented out the following lines and the script runs but of course
>doesnt do anything. It is the DataRow statement
> objDataRow = objDataTable.NewRow()
>
>
> Why would this not work?
>
>
>
> `objDataRow = objDataTable.NewRow()
>
>
>
> ``Create Record Field Values here
>
> `objDataRow.Item("Name") = strName
>
> `objDataRow.Item("Playingname") = strPlayingname
>
> `objDataRow.Item("UserName") = strUserName
>
> `objDataRow.Item("Password") = strPassword
>
> `objDataRow.Item("Location") = strLocation
>
> `objDataRow.Item("Email") = strEmail
>
> `objDataRow.Item("Age") = strAge
>
> `objDataRow.Item("Icq") = strIcq
>
> `objDataRow.Item("Aim") = strAim
>
> `objDataRow.Item("Occupation") = strOccupation
>
> `objDataRow.Item("Bio") = strBio
>
> `objDataRow.Item("PersonalInformation") = strPersonalInformation
>
> `objDataRow.Item("GamesPlayed") = strGamesPlayed
>
> `objDataRow.Item("Connect") = strConnect
>
> `objDataRow.Item("OS") = strOS
>
> `objDataRow.Item("Processor") = strProcessor
>
> `objDataRow.Item("Ram") = strRam
>
> `objDataRow.Item("Videocard") = strVideocard
>
> `objDataRow.Item("Soundcard") = strSoundcard
>
> `objDataRow.Item("Harddrive") = strHarddrive
>
> `objDataRow.Item("Additionalsysteminformation") =
> strAdditionalsysteminformation
>
> `objDataRow.Item("Photo") = strPhoto
>
> `objDataRow.Item("SystemPhoto") = strSystemPhoto
>
> `objDataTable.Rows.Add(objDataRow)
>
> `objDataAdapter.Update(objDataTable)
>
>
>
>
>
>
>
> Have a nice day.
> ----- Original Message -----
> From: <System-Administrator@...>
> To: <AspNetAnyQuestionIsOk@yahoogroups.com>
> Sent: Tuesday, January 11, 2005 8:10 PM
> Subject: Re: [AspNetAnyQuestionIsOk] Form wil not submit.
>
>
>> It says line 169 which appears to be this line
>>
>> objDataRow = objDataTable.NewRow()
>>
>>
>> The html page has 2 panels.
>> PanelJoin
>> PanelComplete.
>>
>>
>> Inside PanelComplete is a ASP Repeater named tblBTC....
>>
>>
>> The names seem to be correct. I don`t know why it would hose on that
>> line. a the lines before it seem to do fine.
>>
>>
>> objDataAdapter.Fill(objDataSet, "BTC MEMBERS")
>>
>> objDataTable = objDataSet.Tables("tblBTC")
>>
>> objDataRow = objDataTable.NewRow()
>>
>>
>>
>> Have a nice day.
>> ----- Original Message -----
>> From: "Mark E" <meckeard2000@...>
>> To: <AspNetAnyQuestionIsOk@yahoogroups.com>
>> Sent: Tuesday, January 11, 2005 7:51 PM
>> Subject: Re: [AspNetAnyQuestionIsOk] Form wil not submit.
>>
>>
>>>
>>> I usually see this when I am trying to access a control that doesn`t
>>> exist. Or I misspelled the control name.
>>>
>>> Double check to make sure that you are correctly referencing all your
>>> controls.
>>>
>>> Mark
>>>
>>> System-Administrator@... wrote:
>>> I have built the page and things work except udating the database. I get
>>> an error and have searched on the net but cannot figure out how to fix
>>> it. The error im getting is listed below. I am so close to making this
>>> work. It is probably something silly. Thank you. Awsome group.
>>>
>>> ERROR
>>>
>>> Server Error in `/btcNET` Application.
>>>
--------------------------------------------------------------------------------
>>>
>>> Object reference not set to an instance of an object.
>>> 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.NullReferenceException: Object reference not
>>> set to an instance of an object.
>>>
>>> Source Error:
>>>
>>> An unhandled exception was generated during the execution of the
>>> current web request. Information regarding the origin and location of
>>> the exception can be identified using the exception stack trace below.
>>>
>>> Stack Trace:
>>>
>>> [NullReferenceException: Object reference not set to an instance of an
>>> object.]
>>> btcNET.JoinBTC.Page_Load(Object sender, EventArgs e) in
>>> \webslavewwwroot$tcNETJoinBTC.aspx.vb:169
>>> System.Web.UI.Control.OnLoad(EventArgs e) +102
>>> System.Web.UI.Control.LoadRecursive() +45
>>> System.Web.UI.Page.ProcessRequestMain(Boolean
>>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>>> +952
>>>
>>>
>>>
>>>
--------------------------------------------------------------------------------
>>> Version Information: Microsoft .NET Framework Version:2.0.40607.42;
>>> ASP.NET Version:2.0.40607.42
>>>
>>> ERROR
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Here is the page code:
>>>
>>> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
>>> System.EventArgs) Handles MyBase.Load
>>>
>>>
>>> If IsPostBack Then
>>> Dim strName, strPlayingname, strUserName, strPassword,
>>> strLocation, strEmail, strAge, strIcq, strAim, strOccupation
>>> Dim strBio, strPersonalInformation, strGamesPlayed,
>>> strConnect, strOS, strProcessor, strRam, strVideocard
>>> Dim strSoundcard, strHarddrive,
>>> strAdditionalsysteminformation, strPhoto, strSystemPhoto
>>>
>>> strName = Request.Form("name")
>>> strPlayingname = Request.Form("playingname")
>>> strUserName = Request.Form("username")
>>> strPassword = Request.Form("password")
>>> strLocation = Request.Form("location")
>>> strEmail = Request.Form("email")
>>> strAge = Request.Form("age")
>>> strIcq = Request.Form("icq")
>>> strAim = Request.Form("aim")
>>> strOccupation = Request.Form("occupation")
>>> strBio = Request.Form("bio")
>>> strPersonalInformation = Request.Form("personalinformation")
>>> strGamesPlayed = Request.Form("gamesplayed")
>>> strConnect = Request.Form("connect")
>>> strOS = Request.Form("os")
>>> strProcessor = Request.Form("processor")
>>> strRam = Request.Form("ram")
>>> strVideocard = Request.Form("videocard")
>>> strSoundcard = Request.Form("soundcard")
>>> strHarddrive = Request.Form("harddrive")
>>> strAdditionalsysteminformation =
>>> Request.Form("additionalsysteminformation")
>>> strPhoto = Request.Form("Photo")
>>> strSystemPhoto = Request.Form("SystemPhoto")
>>>
>>> `Testing variables
>>> `Response.Write(strName)
>>> `Response.Write(strPlayingname)
>>> `Response.Write(strUserName)
>>> `Response.Write(strPassword)
>>> `Response.Write(strLocation)
>>> `Response.Write(strEmail)
>>> `Response.Write(strAge)
>>> `Response.Write(strIcq)
>>> `Response.Write(strAim)
>>> `Response.Write(strOccupation)
>>> `Response.Write(strBio)
>>> `Response.Write(strPersonalInformation)
>>> `Response.Write(strGamesPlayed)
>>> `Response.Write(strConnect)
>>> `Response.Write(strOS)
>>> `Response.Write(strProcessor)
>>> `Response.Write(strRam)
>>> `Response.Write(strVideocard)
>>> `Response.Write(strSoundcard)
>>> `Response.Write(strHarddrive)
>>> `Response.Write(strAdditionalsysteminformation)
>>> `Response.Write(strPhoto)
>>> `Response.Write(strSystemPhoto)
>>>
>>>
>>> `Hide The Form on Submit
>>> PanelJoin.Visible = False
>>>
>>>
>>>
>>> `Open the Connection -------------------------------------
>>> Dim objConn As OleDbConnection
>>> Dim objConnString As String =
>>> "Provider=Microsoft.Jet.OLEDB.4.0;Data
>>> Source=C:InetpubwwwroottcNETDBelcherman.mdb"
>>> objConn = New OleDb.OleDbConnection(objConnString)
>>> objConn.Open()
>>> `---------------------------------------------------------
>>>
>>> `Create a DataSet ----------------------------------------
>>> Dim objDataSet As New DataSet
>>> `Create a DataSet ----------------------------------------
>>>
>>> `Build SQL String --------------------------------------
>>> Dim strSQLstring As String
>>> strSQLstring = "SELECT * FROM tblBTC"
>>> `-------------------------------------------------------
>>>
>>> `Create a DataAdapter ------------------------------------
>>> Dim objDataAdapter As OleDbDataAdapter
>>> objDataAdapter = New OleDbDataAdapter(strSQLstring, objConn)
>>> `Create a DataAdapter ------------------------------------
>>>
>>> `Create a DataTable ----------------------------------------
>>> Dim objDataTable As DataTable
>>> `Create a DataTable ----------------------------------------
>>>
>>> `Create a DataRow ----------------------------------------
>>> Dim objDataRow As DataRow
>>> `Create a DataRow ----------------------------------------
>>>
>>> objDataAdapter.Fill(objDataSet, "BTC MEMBERS")
>>>
>>> objDataTable = objDataSet.Tables("tblBTC")
>>>
>>> objDataRow = objDataTable.NewRow()
>>>
>>> `Create Record Field Values here
>>> objDataRow.Item("Name") = strName
>>> objDataRow.Item("Playingname") = strPlayingname
>>> objDataRow.Item("UserName") = strUserName
>>> objDataRow.Item("Password") = strPassword
>>> objDataRow.Item("Location") = strLocation
>>> objDataRow.Item("Email") = strEmail
>>> objDataRow.Item("Age") = strAge
>>> objDataRow.Item("Icq") = strIcq
>>> objDataRow.Item("Aim") = strAim
>>> objDataRow.Item("Occupation") = strOccupation
>>> objDataRow.Item("Bio") = strBio
>>> objDataRow.Item("PersonalInformation") =
>>> strPersonalInformation
>>> objDataRow.Item("GamesPlayed") = strGamesPlayed
>>> objDataRow.Item("Connect") = strConnect
>>> objDataRow.Item("OS") = strOS
>>> objDataRow.Item("Processor") = strProcessor
>>> objDataRow.Item("Ram") = strRam
>>> objDataRow.Item("Videocard") = strVideocard
>>> objDataRow.Item("Soundcard") = strSoundcard
>>> objDataRow.Item("Harddrive") = strHarddrive
>>> objDataRow.Item("Additionalsysteminformation") =
>>> strAdditionalsysteminformation
>>> objDataRow.Item("Photo") = strPhoto
>>> objDataRow.Item("SystemPhoto") = strSystemPhoto
>>>
>>> objDataTable.Rows.Add(objDataRow)
>>> objDataAdapter.Update(objDataTable)
>>>
>>>
>>> tblBTC.DataSource = objDataSet
>>> tblBTC.DataBind()
>>>
>>>
>>> `Show Completed Profile
>>> PanelComplete.Visible = True
>>>
>>> `Close things up ------------------------------------
>>> objDataSet.Dispose()
>>> objDataSet = Nothing
>>>
>>> objDataAdapter = Nothing
>>>
>>> objConn.Close()
>>> objConn = Nothing
>>> `Close things up ------------------------------------
>>>
>>>
>>>
>>> Else
>>> PanelJoin.Visible = True
>>> PanelComplete.Visible = False
>>>
>>>
>>> End If
>>>
>>>
>>>
>>>
>>> End Sub
>>>
>>>
>>>
>>>
>>> End Class
>>> End Page code:
>>>
>>>
>>>
>>> Mike Belcher
>>> Independent Computer Consultant
>>>
>>>
>>>
>>> [Non-text portions of this message have been removed]
>>>
>>>
>>>
>>> ---------------------------------
>>> Yahoo! Groups Links
>>>
>>> To visit your group on the web, go to:
>>> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>>>
>>> To unsubscribe from this group, send an email to:
>>> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>>>
>>> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>>>
>>>
>>>
>>> [Non-text portions of this message have been removed]
>>>
>>>
>>>
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>
>
Joined: 11 Jan 2006
Posts: 46
Re: Form wil not submit. UPDATE
Odds are objDataTable has not been instantiated Could be the DataSet
did not fill or the table tblBTC doesn`t exist.
HTH,
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Joined: 03 Jan 2005
Posts: 15
Re: Form wil not submit. UPDATE
It does though. That same code I took from a working page. All the way to
>>> objDataTable = objDataSet.Tables("tblBTC")
>>>
>>> objDataRow = objDataTable.NewRow()
works on another page. Also if i comment the datarow items out it wil
display in the repeater a recod from the dataset and tblBTC. It is on that
one line that it says the error.
Have a nice day.
----- Original Message -----
From: "Dean Fiala" <dfiala@...>
To: <AspNetAnyQuestionIsOk@yahoogroups.com>
Sent: Tuesday, January 11, 2005 11:34 PM
Subject: Re: [AspNetAnyQuestionIsOk] Form wil not submit. UPDATE
>
> Odds are objDataTable has not been instantiated Could be the DataSet
> did not fill or the table tblBTC doesn`t exist.
>
> HTH,
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
Joined: 12 Jan 2005
Posts: 1
Re: Form wil not submit. UPDATE
Make sure you have the proper permissions on the database.
_____
From: System-Administrator@...
[mailto:System-Administrator@...]
Sent: Wednesday, January 12, 2005 1:29 AM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Form wil not submit. UPDATE
It does though. That same code I took from a working page. All the way to
>>> objDataTable = objDataSet.Tables("tblBTC")
>>>
>>> objDataRow = objDataTable.NewRow()
works on another page. Also if i comment the datarow items out it wil
display in the repeater a recod from the dataset and tblBTC. It is on that
one line that it says the error.
Have a nice day.
----- Original Message -----
From: "Dean Fiala" <dfiala@...>
To: <AspNetAnyQuestionIsOk@yahoogroups.com>
Sent: Tuesday, January 11, 2005 11:34 PM
Subject: Re: [AspNetAnyQuestionIsOk] Form wil not submit. UPDATE
>
> Odds are objDataTable has not been instantiated Could be the DataSet
> did not fill or the table tblBTC doesn`t exist.
>
> HTH,
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=129o1oam9/M=298184.5639630.6699735.3001176/D=gr
oups/S=1705006764:HM/EXP=1105608668/A=2495208/R=0/SIG=11egg01lg/*http://www.
netflix.com/Default?mqso=60188914> click here
<http://us.adserver.yahoo.com/l?M=298184.5639630.6699735.3001176/D=groups/S=
:HM/A=2495208/rand=919136888>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
Joined: 03 Jan 2005
Posts: 15
Re: Form wil not submit. UPDATE
Well i didfix the original error with
When calling:
objDataAdapter.Fill(objDataSet, "BTC MEMBERS")
I was asking the DataAdapter to create a table called "BTC MEMBERS". So
later on when I do this:
objDataTable = objDataSet.Tables("tblBTC")
I am asking for a table from the DataSet that`s not there. Changing to this
fix the problem:
objDataAdapter.Fill(objDataSet, "tblBTC")
but now im getting an error on the Line were it updates.
objDataAdapter.Update(objDataTable)
Server Error in `/btcNET` Application.
--------------------------------------------------------------------------------
Update requires a valid InsertCommand when passed DataRow collection with
new rows.
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.InvalidOperationException: Update requires a valid
InsertCommand when passed DataRow collection with new rows.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Have a nice day.
----- Original Message -----
From: "Scott Phelps" <scottp@...>
To: <AspNetAnyQuestionIsOk@yahoogroups.com>
Sent: Wednesday, January 12, 2005 4:34 AM
Subject: RE: [AspNetAnyQuestionIsOk] Form wil not submit. UPDATE
>
>
> Make sure you have the proper permissions on the database.
>
> _____
>
> From: System-Administrator@...
> [mailto:System-Administrator@...]
> Sent: Wednesday, January 12, 2005 1:29 AM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] Form wil not submit. UPDATE
>
>
> It does though. That same code I took from a working page. All the way to
>
>>>> objDataTable = objDataSet.Tables("tblBTC")
>>>>
>>>> objDataRow = objDataTable.NewRow()
>
>
> works on another page. Also if i comment the datarow items out it wil
> display in the repeater a recod from the dataset and tblBTC. It is on that
> one line that it says the error.
>
>
> Have a nice day.
> ----- Original Message -----
> From: "Dean Fiala" <dfiala@...>
> To: <AspNetAnyQuestionIsOk@yahoogroups.com>
> Sent: Tuesday, January 11, 2005 11:34 PM
> Subject: Re: [AspNetAnyQuestionIsOk] Form wil not submit. UPDATE
>
>
>>
>> Odds are objDataTable has not been instantiated Could be the DataSet
>> did not fill or the table tblBTC doesn`t exist.
>>
>> HTH,
>> --
>> Dean Fiala
>> Very Practical Software, Inc
>> http://www.vpsw.com
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
> Yahoo! Groups Sponsor
>
> ADVERTISEMENT
>
> <http://us.ard.yahoo.com/SIG=129o1oam9/M=298184.5639630.6699735.3001176/D=gr
> oups/S=1705006764:HM/EXP=1105608668/A=2495208/R=0/SIG=11egg01lg/*http://www.
> netflix.com/Default?mqso=60188914> click here
>
> <http://us.adserver.yahoo.com/l?M=298184.5639630.6699735.3001176/D=groups/S=
> :HM/A=2495208/rand=919136888>
>
> _____
>
> Yahoo! Groups Links
>
>
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







