473,396 Members | 2,002 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,396 software developers and data experts.

Saving Error

gsgurdeep
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
Dec 23 '08 #1
12 1454
truezplaya
115 100+
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
Dec 23 '08 #2
Frinavale
9,735 Expert Mod 8TB
@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
Dec 23 '08 #3
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.
Dec 25 '08 #4
MrMancunian
569 Expert 512MB
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
Dec 27 '08 #5
Frinavale
9,735 Expert Mod 8TB
@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.
Dec 29 '08 #6
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 ......
Jan 7 '09 #7
r035198x
13,262 8TB
Any chance we'll get to see the code that's inserting the rich text?
Jan 7 '09 #8
Here is my code
Expand|Select|Wrap|Line Numbers
  1. DIM conString As String = "provider=SqlOleDb; Data Source=SERVER;Initial Catalog=DATA_BASE;Persist Security Info=True;User ID=SA"
  2.  
  3. Dim  m1, m2, m3, m4, m5 As String
  4.  
  5. m1=0
  6. m2 =text_name.Text.Trim 'ITEM MODEL
  7. m3 = text_part.Text.Trim 'ITEM PART NO.
  8. m4 = rich_text.Rtf.Trim 'ITEM DESCRIPTION OR SPECIFICATION
  9. m5 = text_model.Text.Trim  'ITEM MODEL NO.
  10.  
  11. Try
  12.             Dim Db As OleDb.OleDbConnection
  13.             Dim Cmd As OleDb.OleDbCommand
  14.             Dim Rs As OleDb.OleDbDataReader
  15.             Db = New OleDb.OleDbConnection(conString)
  16.             Db.Open()
  17.             Cmd = New OleDb.OleDbCommand
  18.             Cmd.CommandText = "Insert Into items Values ('" & m1 & "', '" & m2 & "', '" & m3 & "', '" & m4 & "', '" & m5 & "')"
  19.             Cmd.Connection = Db
  20.             Rs = Cmd.ExecuteReader
  21.             Rs.Close()
  22.             Db.Close()
  23. Catch ex As Exception
  24.             MsgBox("insert+++++++++++++" & ex.Message)
  25. End Try
it works fine if i use

Expand|Select|Wrap|Line Numbers
  1. m4 = rich_text.text.Trim 
in place of
Expand|Select|Wrap|Line Numbers
  1. m4 = rich_text.Rtf.Trim 
please help me
Jan 8 '09 #9
r035198x
13,262 8TB
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.
Jan 8 '09 #10
I Have used ExecuteNonQuery instead of ExecuteReader, But Result is same.

Again Modified code run well with
Expand|Select|Wrap|Line Numbers
  1. m4=rich_text.text.trim 
but says error when
Expand|Select|Wrap|Line Numbers
  1.  m4=rich_text.rtf 

My Try Catch Block says following Error
" Syntex Error or Access Violation. "
Jan 12 '09 #11
r035198x
13,262 8TB
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)?
Jan 12 '09 #12
raids51
59
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.
Jan 13 '09 #13

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

Similar topics

4
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+....
3
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+....
1
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: ...
0
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...
3
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);...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
tracyyun
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 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.