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!!!) - Protected Function sqlparameter_insert_newscat() As SqlParameter()
-
Dim sqlparam(4) As SqlParameter
-
Dim ddlstatus As Boolean
-
If rbActive.Items(0).Selected = True Then
-
ddlstatus = True
-
Else
-
ddlstatus = False
-
End If
-
sqlparam(0) = New SqlParameter("@username", SqlDbType.VarChar, 30, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, Session("user.id"))
-
sqlparam(1) = New SqlParameter("@news_category", SqlDbType.VarChar, 255, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, news_category.text)
-
sqlparam(2) = New SqlParameter("@news_category_desc", SqlDbType.Text, 1000000, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, HttpUtility.HtmlEncode(news_category_desc.innertext))
-
sqlparam(3) = New SqlParameter("@news_category_status", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, ddlstatus)
-
sqlparam(4) = New SqlParameter("@news_category_parent", SqlDbType.BigInt, 100, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, ddlRoot.SelectedValue)
-
Return sqlparam
-
End Function
2 1474
somebody expert please help me...
you are missing the selected value of ddlstatus -
sqlparam(3) = New SqlParameter("@news_category_status", SqlDbType.Bit, 1, ParameterDirection.Input, False, 0, 0, "", DataRowVersion.Current, ddlstatus.SelectedValue)
-
-
Sign in to post your reply or Sign up for a free account.
Similar topics
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....
|
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 =...
|
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...
|
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: ...
|
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
|
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...
|
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...
|
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?
|
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 ...
|
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,...
|
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,...
|
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$) {
}
...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |