sqlexception Questions

3

Solved

I wrote a console app that just calls a stored procedure in a SQL Server database. Then I set up a Windows Task Scheduler event to call the console app's .exe file every 5 minutes. Most of the time...

7

I'm very new to C#. When I try catch something like this: try { connection.Open(); command.ExecuteNonQuery(); } catch(SqlException ex) { MessageBox.Show("there was an issue!"); } How do I kn...
Seismology asked 14/11, 2013 at 5:42

18

Solved

I have an Insert stored procedure which will feed data to Table1 and get the Column1 value from Table1 and call the second stored procedure which will feed the Table2. But when I call The second s...
Tweeny asked 21/2, 2014 at 9:23

2

Solved

I'm working at a RestController and I try to handle the SQLIntegrityConstraintViolationException using try-catch blocks but I don't know why the catch block is never executed. This is the RestCont...
Orlov asked 4/1, 2019 at 9:1

6

Solved

I'm getting this exception when I try to run this program. It's one of the Microsoft examples. I've added the sqljdbc4.jar to the classpath in netbeans for both compile and Run, via the project pro...
Tigre asked 11/4, 2011 at 4:56

3

Solved

I use System.Data.Common.DbCommand to insert a new row to database. The point is, that this row already exists. try { [...] DbCommand insertCommand = [...] insertCommand.ExecuteScalar(); [...]...
Jarid asked 10/3, 2015 at 10:34

4

Solved

the last days I was trying to learn how to access mySQL databases via Java. I am able to load the driver and get a connection to the database ( at least I think so, since I don't get an exception ...
Elyssa asked 4/6, 2013 at 21:33

12

Solved

I have small Java Application, which execute every day and checks for data in database using Cronj Schedular and everything works fine, but recently I have observed that, it is failing due to jav...
Ungula asked 25/6, 2015 at 2:52

2

I've got a stored procedure that is giving me a SqlException because of a timeout when I run it from code (with timeout set to 30). When I run the procedure directly in Management Studio, it execut...
Blowing asked 17/8, 2011 at 17:6

1

Solved

I like to create a registration form where user can register his or her data and the given data will be saved on a database. I created a database HospitalM using mysql workbench 8.0. I ran the proj...
Commentator asked 28/11, 2021 at 0:11

8

Solved

I have the following piece of inline SQL that I run from a C# windows service: UPDATE table_name SET status_cd = '2', sdate = CAST('03/28/2011 18:03:40' AS DATETIME), bat_id = '33acff9b-e2b4...
Mccormac asked 28/3, 2011 at 23:10

4

Solved

I have the following code: public string getFinalCon(string desid) { string finalConId = null; try { query = "select finalConID from discussions where desid=@did"; com = new SqlComma...
Turnkey asked 27/11, 2012 at 7:12

16

Solved

I am trying to test some exceptions in my project and one of the Exceptions I catch is SQlException. It seems that you can't go new SqlException() so I am not sure how I can throw an exception espe...
Dolphin asked 6/9, 2009 at 23:11

4

Solved

I've got a logger that records exception information for our in house applications. When we log SQL exceptions it'd be super useful if we could see the actual query that caused the exception. Is ...
Maddux asked 3/6, 2010 at 10:1

9

Solved

My web site was working flawless in the old Host, But now i Moved to a new host Please pay attention: The Old host was a VPS on the same host So i'v stoped paying him and now i'm hosting on the s...
Foreleg asked 14/10, 2011 at 1:25

7

I am developing a C# application with its backend as sqlite. In my application I have a button for cleaning the database (deleting the .db file and creating it again with some initial data). Someti...
Baer asked 17/6, 2011 at 10:4

6

public static Connection getConnection()throws SQLException,ClassNotFoundException { String username="scott"; String password="tiger"; String url="jdbc:oracle:thin:@localhost:1521"; Connection...
Kamerad asked 2/12, 2012 at 9:0

1

Since last 3 days I am getting problem with just simple connection of Android - Oracle 12c Database. Recently I have uploaded Android-Oracle-Connection but its for 11g version. I have used ojdbc1...
Burtonburty asked 23/11, 2019 at 11:2

9

Solved

How can i catch this Exception : com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '22-85' for key 'ID_CONTACT'
Marolda asked 20/12, 2014 at 17:48

11

I have the following string value: "walmart obama 👽💔" I am using MySQL and Java. I am getting the following exception: `java.sql.SQLException: Incorrect string value: '\xF0\x9F\x91\xBD\xF0\x9F....
Impunity asked 30/11, 2012 at 21:51

5

Solved

When I run the following servlet: // package projectcodes; public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException { String UserID = reques...
Erichericha asked 24/4, 2012 at 13:24

10

Solved

Can someone explain the difference between catching an Exception and catching an SQLException? I know that SQLException will print out more information if you choose to print out the exception erro...
Howzell asked 8/4, 2014 at 18:11

3

Solved

I'm having a problem finishing an SQLite transaction and I'm totally baffled on how to do it. It totally looks like this bug from 2007. I'm creating my employee table (which references another tabl...
Homiletics asked 11/8, 2014 at 13:56

9

Solved

Q: Is there a better way to handle SqlExceptions? The below examples rely on interpreting the text in the message. Eg1: I have an existing try catch to handle if a table does not exist. Ignore ...
Tippler asked 3/6, 2011 at 0:54

4

Solved

I'm developing a Webservice at the moment. I thought I was ready to release my first productive version but I keep getting a SQLException which doesn't make any sense to me. I'm developing against ...
Moonshine asked 3/3, 2015 at 9:17

© 2022 - 2024 — McMap. All rights reserved.