473,385 Members | 1,863 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,385 software developers and data experts.

Why does posted data always return empty?

i always got the empty string in form data posting. can you describe what the hell happened in my code? always got the empty string to insert to SQL server even it is drop down list selected value is empty. Is this the error in visual studio cause sometimes i can get the value and sometimes can't (inconsistent!!!)

Expand|Select|Wrap|Line Numbers
  1. Protected Function sqlparameter_insert_newscat() As SqlParameter()
  2.         Dim sqlparam(4) As SqlParameter
  3.         Dim ddlstatus As Boolean
  4.         If rbActive.Items(0).Selected = True Then
  5.             ddlstatus = True
  6.         Else
  7.             ddlstatus = False
  8.         End If
  9.         sqlparam(0) = New SqlParameter("@username", SqlDbType.VarChar, 30, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, Session("user.id"))
  10.         sqlparam(1) = New SqlParameter("@news_category", SqlDbType.VarChar, 255, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, news_category.text)
  11.         sqlparam(2) = New SqlParameter("@news_category_desc", SqlDbType.Text, 1000000, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, HttpUtility.HtmlEncode(news_category_desc.innertext))
  12.         sqlparam(3) = New SqlParameter("@news_category_status", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, ddlstatus)
  13.         sqlparam(4) = New SqlParameter("@news_category_parent", SqlDbType.BigInt, 100, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, ddlRoot.SelectedValue)
  14.         Return sqlparam
  15.     End Function
Jan 25 '11 #1
2 1474
somebody expert please help me...
Jan 25 '11 #2
semomaniz
210 Expert 100+
you are missing the selected value of ddlstatus

Expand|Select|Wrap|Line Numbers
  1. sqlparam(3) = New SqlParameter("@news_category_status", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, ddlstatus.SelectedValue)
  2.  
  3.  
Jan 27 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Stefan Mueller | last post by:
I'm trying to write a PHP script which allows to enter an username and a password and to click two buttons. If I start my PHP scripts 'mytest.php' I see the two input fields and the two buttons....
15
by: Håkan Persson | last post by:
Hi. I am trying to set up a simple HTTP-server but I have problems reading data that is beeing POSTed. class httpServer(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): input =...
4
by: Daniel Fisherman | last post by:
In the code below, the statement 'Print @Sites' prints nothing, even though the cursor contains 4 records, and 'Print @Site' prints the appropriate values. Can anyone see my mistake? I am...
0
by: riccoi | last post by:
Hi. I had created a Windows Application ant put there the code down there. I am trying to get information about the processes that are currently running in my machine. The problem is: ...
3
by: lucilue2003 | last post by:
How do i get all the posted data. Suppose i have a form page (myform.html) and i am SENDING data to form.asp, how do i retrieve all data that was sent by post and by get ? THanks
0
by: buran | last post by:
Dear ASP.NET Programmers, I am saving the contents of a file to the database using HttpWebRequest and HttpWebResponse classes. I am also posting some data to the requested page. What I cannot...
1
by: buran | last post by:
Hi, I am posting some data in Turkish with the HttpWebRequest and saving the response stream in the database. The characters in the page are shown properly but the Turkish characters in the...
1
by: ad | last post by:
I use GridView in a Web Form. When the data is empty, it only who the EmptyDataText or EmptyDataTempate, and all the field is invisible How can I show all the field when the data is empty?
1
by: jobs | last post by:
The below always results in an empty table, when I know the Gridview has rows. Dim dataTable As DataTable = CType(ChargeGridView.DataSource, DataTable) If Not (dataTable Is Nothing) Then ...
3
by: FKlusmann | last post by:
I have inherited a big, messy table with duplicated data and empty fields consisting of Names (business, client, supplier, etc.), Addresses ( physical, mailing, shipping, billing), Orders ( Date,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.