When I insert rtf data from rich text box in sql table containing 3 char(255) type columns + char(6000) columns it returns access violation error.
what it mean
&
waht is the solution
Please Help Me soon
12 1454
i think you need to do more reasearch in to this before posting comments on here otherwise you will have the admin telling you that they don't give answers you work towards your answers
@gsgurdeep
What is causing the error?
The code accessing the rich text box?
Or the code saving the information to the database?
Please post your error message and explain your problem in more detail so that we can help you better. Include things like: What you've tried so far, What you think is causing the problem, and any error messages are you getting
-Frinny
I used to post my problems after lot of search on Google & MSN.
There is no specific error message, only says Saving data in table fails.
Can you insert your code in a Try...Catch-block and see what 'ex' is returning? Otherwise, it's impossible for us to come up with an answer...
Steven
@gsgurdeep
I would check to make sure that your SQL statement for saving the data is correct.
Use something like Query Analyzer to test your SQL.
If I insert plaint text data inserted successfully. but when i used any bulleted rich text it throw error says. "Error Insert"
Try Catch block is replied same.
but when
I used Query Analyzer for inserting data.....
this reply with an error..........says
Access Violation.............
Please Help Me ......
Any chance we'll get to see the code that's inserting the rich text?
Here is my code - DIM conString As String = "provider=SqlOleDb; Data Source=SERVER;Initial Catalog=DATA_BASE;Persist Security Info=True;User ID=SA"
-
-
Dim m1, m2, m3, m4, m5 As String
-
-
m1=0
-
m2 =text_name.Text.Trim 'ITEM MODEL
-
m3 = text_part.Text.Trim 'ITEM PART NO.
-
m4 = rich_text.Rtf.Trim 'ITEM DESCRIPTION OR SPECIFICATION
-
m5 = text_model.Text.Trim 'ITEM MODEL NO.
-
-
Try
-
Dim Db As OleDb.OleDbConnection
-
Dim Cmd As OleDb.OleDbCommand
-
Dim Rs As OleDb.OleDbDataReader
-
Db = New OleDb.OleDbConnection(conString)
-
Db.Open()
-
Cmd = New OleDb.OleDbCommand
-
Cmd.CommandText = "Insert Into items Values ('" & m1 & "', '" & m2 & "', '" & m3 & "', '" & m4 & "', '" & m5 & "')"
-
Cmd.Connection = Db
-
Rs = Cmd.ExecuteReader
-
Rs.Close()
-
Db.Close()
-
Catch ex As Exception
-
MsgBox("insert+++++++++++++" & ex.Message)
-
End Try
it works fine if i use
in place of
please help me
Shouldn't you be using ExecuteNonQuery instead of ExecuteReader which you only use for select statements?
Make that change, try it and post the full error message that you get exactly as it is.
P.S You should also be using parameters for this type of thing.
I Have used ExecuteNonQuery instead of ExecuteReader, But Result is same.
Again Modified code run well with
but says error when
My Try Catch Block says following Error
" Syntex Error or Access Violation. "
Now print out the command text before executing the query to see if your command is valid. Post the text that's printed as well.
P.S Which version of SQL server are you using (if you are using SQL server that is)?
what might be happening is that some character in the string(because with all those weird characters that the rtf format puts in there ) may be messin with sql and tellin it to do some command, kinda like how sql injection works(putting quotes in the beginning of the string will allow you to run a sql command on it EX the query 'and 1=1 in a login name would tell sql server the command if password = '' and 1=1 then login.... if im not bein clear then you can google this). so this would throw a syntax error. im just puttin some ideas out there.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Michael Kennedy [UB] |
last post by:
Hi Everyone,
I have this multithreaded C# windows forms application which does a lot of
image processing. Occasionally, I get the following error:
A generic error occurred in GDI+....
|
by: Michael Kennedy [UB] |
last post by:
Hi Everyone,
I have this multithreaded C# windows forms application which does a lot of
image processing. Occasionally, I get the following error:
A generic error occurred in GDI+....
|
by: M Keeton |
last post by:
I currently have a picture which is stored in a "System.Drawing.Image"
variable and I want to save it as a bitmap file.
I have tried 2 different approaches and both give me the following error:
...
|
by: Tony K |
last post by:
ERROR MESSAGE RECEIVED WHEN SAVING.
"The operation could not be completed. No such interface supported."
Dell Inspirion E1705, 1GB RAM, Windows Vista Ultimate
I can start debugging and the...
|
by: uday1302 |
last post by:
Hi Dear,
Here I am trying to upload a photo.
protected void LoadImage() {
string UserName = Session.ToString();
byte Data = Profile.GetImageData(UserName);...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: 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...
| |