I have a submit button, where users are clicking after entering text into textboxes and (hopefully) check boxes (for yes/no).
Here is my code, and when I run it and press submit, there is no action. It just continues to loop. Any ideas why? -
string ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True";
-
-
using (SqlConnection dataConnection = new SqlConnection(ConnectionString))
-
{
-
using (SqlCommand dataCommand = dataConnection.CreateCommand())
-
{
-
dataCommand.CommandText = "INSERT INTO Review_Tbl (course_num, courseName, courseDesc, numQuiz, courseRating, txtBook, txtGrade) " + "VALUES(@CourseNumtxt, @CourseNametxt, @CourseDesctxt, @Quiztxt, @Ratingtxt, @txtBook, @txtGrade)";
-
-
dataCommand.Parameters.AddWithValue("@CourseNumtxt", CourseNumtxt.Text);
-
dataCommand.Parameters.AddWithValue("@CourseNametxt", CourseNametxt.Text);
-
dataCommand.Parameters.AddWithValue("@CourseDesctxt", CourseDesctxt.Text);
-
//dataCommand.Parameters.AddWithValue("@MandatoryCbx", MandatoryCbx.Checked);
-
//dataCommand.Parameters.AddWithValue("@AttendanceCbx", AttendanceCbx.Checked);
-
dataCommand.Parameters.AddWithValue("@Quiztxt", Quiztxt.Text);
-
//dataCommand.Parameters.AddWithValue("@RepeatCbx", RepeatCbx.Checked);
-
dataCommand.Parameters.AddWithValue("@Ratingtxt", Ratingtxt.Text);
-
dataCommand.Parameters.AddWithValue("@txtBook", txtBook.Text);
-
dataCommand.Parameters.AddWithValue("@txtGrade", txtGrade.Text);
-
-
dataConnection.Open();
-
dataCommand.ExecuteNonQuery();
-
dataConnection.Close();
-
Note: I took out the Checkboxes in the code to hopefully get a successful run, to no avail.
3 1341 Frinavale 9,735
Recognized Expert Moderator Expert
I don't see a loop?
Are you sure there is a continuous loop?
Or perhaps your connection string is incorrect and you haven't waited long enough for the database to time out?
-Frinny
I found the error. It was actually mismatches in naming between my sql statement and my database.
The loop I was referring to was actually "Waiting for localhost".. aka what I was entering was never truly being submitted.
Frinavale 9,735
Recognized Expert Moderator Expert
I'm glad you solved it :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: JR |
last post by:
Hi. I hope someone out there who is more versed with JavaScript than
I can help me with the following annoying problem. Here's the
problem.
I have a form with the following layout:
Column A...
|
by: Hongyu |
last post by:
I am trying to implement a simple JavaScript of redirecting my window
to a new URL upon clicking a submit button. This is an easy task except
when I have to put an input type='submit' in front of...
|
by: Dmitry Korolyov [MVP] |
last post by:
When we use
btnSubmit.Attributes = "javascript: this.disabled=true;"
to make the button disabled and prevent users from clicking it again while
form data still posting, there is no longer...
|
by: jbhan |
last post by:
Hi,
I have encountered a strange problem with an asp.net application. I have the
same code deployed on staging and production. On clicking the submit button
the app is supposed to send an email....
|
by: martyn_wynne |
last post by:
Hi,
I have found a odd one, my submit button is not submitting on a
method="get" form after using any form of DataBind?
Has anyone struck this problem before?
here is snipits of the code as...
| |
by: AnandaSim |
last post by:
Hi All,
A really puzzling phenomenon.
I develop to a Windows 2000 development server in VS 2003. I use Copy
Project to deploy the project to a production server.
The webpage I'm having...
|
by: jim whitaker |
last post by:
I followed this tutorial, and I have it working.
http://www.webpasties.com/xmlHttpRequest/
My question is this:
After an AJAX form receives it's data from the server, how could i then
submit...
|
by: Bjorn Sagbakken |
last post by:
Hello.
There maybe an simple answer to this, but sometimes one get a strange
blindness when working intensely on one single problem.
I'm using ASP.NET 2003, building pages that include 3 user...
|
by: soheir |
last post by:
am doing my first project so plz help
i've created a submit button
<input type="submit" onclick="valid()">
my function valid checks if the fields are not empty if empty a window prmpt appears...
|
by: mukeshrasm |
last post by:
Hi
I am having problem like I have four forms which displayed when a tab is clicked. for all these forms initially I made style.display="none" inside div tag and then javascript function is used on...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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...
|
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: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |