Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2008

Tip: Looking for answers? Try searching our database.

FORM value not bein inserted when posting to sql server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
con - 30 Jun 2008 01:11 GMT
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
con - 30 Jun 2008 08:13 GMT
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.

>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
[quoted text clipped - 29 lines]
>
> @lastid = NULL

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.