|
I'm not sure what his ultimate purpose is, but it looks like a pixelating viewer, maybe an editor.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
this code used for generating four picture from input one, in half resolution of the source image.
this applied to print machines , in micromovement technology for decreasing the print resolution in the paper exposing of the digital printing machines.
it may be used in 9 from one or 16 from one picture.
|
|
|
|
|
Hi,
I have a question, i need to store the value of richtextbox to MySQL and retrive the value from MYSQL to richtextbox. can you give me a code in vb.net? and will the formating be affected like the font and alignment?
Can you please respond quicky?
|
|
|
|
|
evilson wrote: Can you please respond quicky?
No.
I don't get why people say stuff like that. We're not hired to do your job, we do it for free. You can't give us deadlines on that.
It's just data, did you bother to try storing it and retrieving it, before asking this question ? Why on earth would storing and retrieving it cause the formatting to change ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Sory about that
I tried it but an error appeared during loading saying type byte cannot convert to string. I dont know what to do next. i already stored the content of the rich text box
this is the full code
<br />
<br />
<br />
Private Sub frmTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
conn = New MySqlConnection()<br />
'connection <br />
myConnString = "connection to server" <br />
conn.ConnectionString = myConnString<br />
conn.Open()<br />
If conn.State = ConnectionState.Closed Then conn.Open()<br />
massDataTable.Clear()<br />
massCommand = New MySqlCommand<br />
massCommand = conn.CreateCommand<br />
massCommand.CommandText = "SELECT * FROM `test` where `mark-1` = 1"<br />
massAdapter.SelectCommand = massCommand<br />
massAdapter.Fill(massDataTable)<br />
With Me<br />
.RichTextBox1.Text = (massDataTable.Rows(0)(1))<br />
End With<br />
End Sub<br />
<br />
|
|
|
|
|
So the correct question is, how do I store a byte[] or how do I convert that to a string, surely ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
If you're a beginner, then perhaps this task is too complex for you. Perhaps you shouldn't be doing paid work at all.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
what you need to save and restore is RichTextBox.Rtf not RichTextBox.Text
Rtf is text+markup; Text is just text.
BTW: why do you choose database field names containing strange characters, as in mark-1? it only makes life difficult without any benefit for anyone.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Before, i use textbox with multiple lines, but my coleauges say they need to do some formating (such as a italicalize headings and underline text and a dozen paragraph), so i use a rich textbox
I name the database field name so it will be easy to remember, but this is just temporary.
|
|
|
|
|
Somehow I think you missed my first point entirely. Anyway look here[^].
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
As Luc said, the reason why the formatting isn't preserved is probably because you're storing the string your getting from the RTB's Text property, when you should be storing the RTB's RTF property instead.
|
|
|
|
|
Hi,
I think you're right. Somehow, i manage to fix the codes and I get what i wanted after doing some research. I'll post the complete codes
And again, thank you for your help
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
With Me<br />
Try<br />
Dim ms As MemoryStream = New MemoryStream<br />
'initializing picture<br />
.RichTextBox1.SaveFile(ms, RichTextBoxStreamType.RichText)<br />
Dim bytBlobData(ms.Length - 1) As Byte<br />
ms.Position = 0<br />
ms.Read(bytBlobData, 0, ms.Length)<br />
<br />
Dim DatabaseParameter As New MySql.Data.MySqlClient.MySqlParameter("@BlobData", MySql.Data.MySqlClient.MySqlDbType.Blob, bytBlobData.Length, ParameterDirection.Input, False, 0, 0, Nothing, DataRowVersion.Current, bytBlobData)<br />
If conn.State = ConnectionState.Closed Then conn.Open()<br />
massCommand = New MySqlCommand<br />
massCommand = conn.CreateCommand<br />
massCommand.CommandText = "insert into `test`" & _<br />
"(`mark-2` ) " & _<br />
"values(@BlobData)"<br />
massCommand.Parameters.Add(DatabaseParameter)<br />
massCommand.ExecuteNonQuery()<br />
Catch ex As Exception<br />
writelog("0001", userid, Now.Date.ToString("MM/dd/yyyy"), Microsoft.VisualBasic.Left(Now.TimeOfDay.ToString, 8), "TEST")<br />
Exit Sub<br />
End Try<br />
End With<br />
End Sub<br />
<br />
Private Sub frmTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
conn = New MySqlConnection()<br />
'connection <br />
myConnString = "server connection"<br />
conn.ConnectionString = myConnString<br />
conn.Open()<br />
If conn.State = ConnectionState.Closed Then conn.Open()<br />
massDataTable.Clear()<br />
massCommand = New MySqlCommand<br />
massCommand = conn.CreateCommand<br />
massCommand.CommandText = "SELECT * FROM `test` where `mark-1` = 3"<br />
massAdapter.SelectCommand = massCommand<br />
massAdapter.Fill(massDataTable)<br />
With Me<br />
Dim rtfcontent As Byte() = DirectCast(massDataTable.Rows(0)(1), Byte())<br />
If Not rtfcontent Is Nothing Then<br />
Using stream As New IO.MemoryStream(rtfcontent)<br />
.RichTextBox1.LoadFile(stream, RichTextBoxStreamType.RichText)<br />
End Using<br />
End If<br />
End With<br />
End Sub<br />
<br />
|
|
|
|
|
How To Store String As ComboBox's ItemData .
e.g
Dim strSQL as string
strSQL = "select IISC, BRANCH FROM RTGS_BRANCHES"
Set RS = Conn.Execute(strSQL)
Do While Not RS.EOF
cboBankBranch.AddItem RS!BRANCH ' string banch name
cboBankBranch.ItemData(cboBankBranch.NewIndex) = rs!IISC ' is alphanumeric code
rs.movenext
loop
rs.close
here when we assign IISC code as string then its giving error while if it an integer then its working fine. Where i am doing mistake ? Please find out the solution. its urgent.
thanx
Nadeem
|
|
|
|
|
nadeem2003 wrote: its urgent.
I asked everyone here, and we all agreed, it's not urgent to us. Don't be rude, if you want free help, you need to wait until someone feels like giving it.
You should read the post on how to ask questions. Perhaps if you told us the error message, that would help. I suspect the error is telling you that the field needs to be a number. If it says that, then it is true. The comboboxitem class has a tag property you can put a string into.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I asked everyone here, and we all agreed,
You did? I did?
Damn my memory is failing me again
But I do agree
|
|
|
|
|
Thanx for taking initiatives and ur precious time. See the code below.Here in step one it is executes well without any error but at line no 4 in step 2, its giving type mismatch error. can u test it in ur end. Please help on this issue. thanx once again for giving ut attention , time & effort.
step 1
1. cboAccountType.AddItem "Current"
2. cboAccountType.ItemData(cboAccountType.NewIndex) = "1"
step 2
3. cboAccountType.AddItem "Saving"
4. cboAccountType.ItemData(cboAccountType.NewIndex) = "S"
|
|
|
|
|
hi,
i have insert date in string format.like this
dim todaydate As String = Format(Today, "dd/MM/yyyy")
there is no problem with dates when i insert.
but wen i am using between query its only short days.
For Example,
Item Name Date
hi 10/3/2000
hi1 15/3/2000
hi2 15/4/2000
hi3 18/4/2000
wen i am use between 01/4/2000 to 18/4/2000.. its show all information.
please help me
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Is this a question that belongs in the SQL forum ? I am confused as to what you're asking, what you're using, and where VB comes in to it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If this is a SQL-server then use the "yyyyMMdd" format in the sql string.
Otherwise you can have that sql-server sees the month as the day and visa versa.
|
|
|
|
|
hi,
i got solution...
i have changed dd/mm/yyyy to dd.mm.yyyy
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Tom above give you much better solution, since "yyyyMMdd" is ISO standard date that sql server understands, if you migrate your sql server to a computer with some other culture set (let's say US) then this date format you wrote "dd.MM.yyyy" is not good, since sql server again does not know which is day and which is month. Either use "yyyyMMdd" or use parameters.
SQL server understands ISO date, and date that is set as it's default culture, and he will behave different on US set server (MM/dd/yyyy) and different for lets say german set server (dd.MM.yyyy).
|
|
|
|
|
I'm new to programming and also struggled with dates and sql a while ago. I tried various date formats but could not get one to work consistently - my day and months would swap around. The yyyyMMdd format worked, but I didn't like the look of it. I then looked into sql parameters and that works perfectly. I would strongly recommend using parameters.
|
|
|
|
|
Hi All,
I have generate problem while i am trying to send mail using guest account.
Error is given Below.
Access to the path 'Global\.net clr networking' is denied
i think it can solution using CASPOL.exe.
So please help me to use CASPOL.exe for applying fulltrust to my application.
Thanks
If you can think then I Can.
|
|
|
|
|
This is STILL not a programming question. It STILL has to do with security configuration on your machine. You STILL do not explain how you're sending mail to get this error. You've had this issue for days, but you can't take the advice you've been given to try to clarify the problem ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|