473,408 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

FORM value not bein inserted when posting to sql server

con
I have created a aspx page which contains a formview with the state set to
"insert", I prepopulate some of the data as seen below and this is visible
on the form.
The information appears on the form but when I view the post via sql
profilter , the data that was "created" from the eval is null?
SQL server 2003
vs 2005
..net framework 2.0
code snippet from aspx page
<asp:TemplateField HeaderText="by User" SortExpression="lastid">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%#
Setid(Eval("lastid")) %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("lastid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

VB backend code

Public Function setid(ByVal itemtype As Object) As Object
Return "test"
End Function

sql snippet value passed to storedprocedure

@lastid = NULL

Jun 30 '08 #1
1 1156
con
Solved the null posting;

set the binding to two way as the source was from an object I moved the key
to the first column and the issue appears to have been rectified.
Unsure as to why this all worked but i hope it saves somebody some time.

"con" <Co*@nospam.nospamwrote in message
news:er**************@TK2MSFTNGP02.phx.gbl...
>I have created a aspx page which contains a formview with the state set to
"insert", I prepopulate some of the data as seen below and this is visible
on the form.
The information appears on the form but when I view the post via sql
profilter , the data that was "created" from the eval is null?
SQL server 2003
vs 2005
.net framework 2.0
code snippet from aspx page
<asp:TemplateField HeaderText="by User"
SortExpression="lastid">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%#
Setid(Eval("lastid")) %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("lastid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

VB backend code

Public Function setid(ByVal itemtype As Object) As Object
Return "test"
End Function

sql snippet value passed to storedprocedure

@lastid = NULL
Jun 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jim | last post by:
Hi, I keep getting form results emailed to me that would indicate a form from my web site is getting submitted with all fields blank or empty, but my code should preventing users from proceeding...
2
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and...
13
by: Ian.Suttle | last post by:
I am have been researching this issue to no end, so any help would be very much appreciated. I have a page with form tags. Inside of the form tags is a panel that contains a user control. The...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
4
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label...
3
by: Miguel Dias Moura | last post by:
Hello, i have a form inserted in a multipage. This multipage has 6 panels. When i finally submit the form a new record in the database is created but the record is allways empty. This is...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
4
by: assgar | last post by:
Hi I am stuck on a problem. I use 3 scripts(form, function and process). Development on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. The form displays...
1
by: Muchach | last post by:
Hello, Ok so what I've got going on is a form that is populated by pulling info from database then using php do{} to create elements in form. I have a text box in each table row for the user to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.