|
|
Ok, here you go
Start()
Work()
End()
Set Graduate = FAIL
If you want some one to write code, employ a programmer - rent a coder is a good site.
Also, at the bottom of each posting here is a link called Reply. Guess what it is for?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
In My application i want to text wheather there are more occurences of '{' than '}' or vice
versa in a rich text box.
How would I go about finding how often each of these charcters occurs?
|
|
|
|
|
Oh... I've just figured it out all by myself
Here's the code if it's useful to anyone else:
'-------------------------------------------------------------------------------
Function FindInstance(ByVal CharacterToFind As String)
Dim Counter As Integer = 0
Dim CurrentPosition As Integer = 0
Dim InstanceCounter As Integer = 0
While Counter < CodeView.TextLength
CodeView.SelectionStart = CurrentPosition
CodeView.SelectionLength = CharacterToFind.Length
If CodeView.SelectedText = CharacterToFind Then
InstanceCounter += 1
End If
CodeView.SelectionLength = 0
CurrentPosition += 1
Counter += 1
End While
Return InstanceCounter
End Function
'--------------------------------------------------------------------------------------
Where 'CodeView' is the textbox/richtextbox being searched.
|
|
|
|
|
hi
sry i didn't understand ur answer
so will u explain it by detailed code in VB.NET
i need to convert the picture into 1's and 0's (points) and write code using array function then send it via GPRS connection . and i'll use UDP packet
|
|
|
|
|
What they mean is nobody is going to write your code for you, so it looks like you will not graduate.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
waz up
what's the question ?!
|
|
|
|
|
i need to convert the image into points.
|
|
|
|
|
witch image ?
" I love deadlines. I like the whooshing sound they make as they fly by. "
|
|
|
|
|
Okay, I'll give you a pointer, assuming you know VB.net, but not much about the graphics classes.
Dim bmp As Bitmap = CType(Image.FromFile("c:\bmp.png"), Bitmap)
For x As Integer = 0 To bmp.Width - 1
For y As Integer = 0 To bmp.Height - 1
Dim pixelAlpha As Byte = bmp.GetPixel(x, y).A
Dim pixelRed As Byte = bmp.GetPixel(x, y).R
Dim pixelGreen As Byte = bmp.GetPixel(x, y).G
Dim pixelBlue As Byte = bmp.GetPixel(x, y).B
Next
Next
This should do the graphics bit - slowly, but it'll work.
On the other side, you will need to use bmp.SetPixel...
bmp.SetPixel(x, y, Color.FromArgb(pixelAlpha, pixelRed, pixelGreen, pixelBlue))
The rest, I'm afraid, is up to you.
|
|
|
|
|
thanks alot for cooperation . i'll try to complete it .
thanks again
|
|
|
|
|
i've tried this code but when i run it it gives error . i could not find the problem so will u help me .
thanx for ur help anyway.
|
|
|
|
|
i've tried this code but it gives me error when i run it. so will u help me.
Dim ImageFile As FileInfo = New FileInfo("c:\1.jpg")
Dim fs As FileStream = New FileStream(ImageFile.FullName, FileMode.Open, FileAccess.Read)
Dim ImageBytes() As Byte
ReDim ImageBytes(CInt(ImageFile.Length))
fs.Read(ImageBytes, 0, CInt(ImageFile.Length))
|
|
|
|
|
Hi to everyone,
I'm just new to Visual Basic .Net, I want to know how to create a simple DATABASE apllication, with ADD, EDIT DELETE option.
Thanks
Raff
|
|
|
|
|
There are a lot of good articles on CodeProject[^], a lot of links on Google[^], and a lot of good books[^] concerning database applications.
|
|
|
|
|
Hi,
VBcity.com has several very good tutiorals on this subject, I found them easy to understand, and easy to follow.
DCB
|
|
|
|
|
Hi,
i have a datagrid with sorting is enabled what i want is after i sort the data to be able to return it to it's default state without sorting.
I am using vb.net 2003 windows application.
thanks
Mohammad Al Hoss
|
|
|
|
|
set the sort = "" should do it - or it might be nohing rather than an empty string
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
can u please give me a code sample
Mohammad Al Hoss
|
|
|
|
|
|
Thanks for your help
Mohammad Al Hoss
|
|
|
|
|
Thats OK, sorry I confused you earlier.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I am working with VB.Net 2005 and I am looking at an Access 2003 mdb. I need to look into a table and see if any records exists that have a value in a certain field based on what is keyed in from a text box...here is what I have so far. I think I am close but when I get to the line "Count2 = CInt(cmd.ExecuteScalar)" I get error..."No value given for one or more required parameters." So I am certainly missing something.
'Check to make sure the Current Department already exisits
Dim Count2 As Integer = 0
Using Connection As New OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comet 631 Databases\Converted to 2003\C022008.mdb")
Dim cmd As OleDbCommand = New OleDbCommand _
("Select Count(ActAcct) as ExistingRecords From [SHACT] where (@CurrDepart)=?", Connection)
cmd.Parameters.AddWithValue("@CurrDepart", OleDbType.VarChar).Value = Me.txtCurGL.Text.ToString + "%"
Connection.Open()
Count2 = CInt(cmd.ExecuteScalar)
End Using
'if the Current Department doesn't exisit then throw message and exit sub
If Count2 <= 0 Then
MessageBox.Show("The GL Department " & Me.txtCurGL.Text.ToString & " does not exisit.", _
"Copy Department", MessageBoxButtons.OK)
Me.txtCurGL.Focus()
Me.txtCurGL.SelectAll()
Return
End If
|
|
|
|
|
For as far as I can see.. you are requesting a fieldname in your table with a parameter :
"...where (@CurrDepart)=?"...
Which is something you can't do in access... you must use an actual string in the Sql command..
Looking at your code.. i'm gessing you made a mistake cause you don't do any check on the me.txtCurGL.text.tostring string and even add a % ( which is not valid for a column name
so...
with cmd
.connection = connection
.commandtext = "select count(ActAcct) as existingRecords from [SHACT] where yourtablenamehere = @CurrDepart"
.parameters.addwithvalue("@CurrDepart",me.txtCurGL.text.Tostring & "%")
end with
connection.open()
Should work a bit better
|
|
|
|
|
Thank you for your reply Noctris. This is what I have now, but I don't think the wildcard is working because no matter what I enter it doesn't find a Count (always 0). Any idea what I might be doing wrong now?
'Check to make sure the Current Department already exisits
Dim Count2 As Integer = 0
Using Connection As New OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comet 631 Databases\Converted to 2003\C022008.mdb")
Dim cmd As OleDbCommand = New OleDbCommand _
("Select Count(ActAcct) as ExistingRecords From [SHACT] where (ActAcct)= @CurrDepart", Connection)
cmd.Parameters.AddWithValue("@CurrDepart", Me.txtCurGL.Text.ToString & "%")
Connection.Open()
Count2 = CInt(cmd.ExecuteScalar)
End Using
'if the Current Department doesn't exisit then throw message and exit sub
If Count2 <= 0 Then
MessageBox.Show("The GL Department " & Me.txtCurGL.Text.ToString & " does not exisit.", _
"Copy Department", MessageBoxButtons.OK)
Me.txtCurGL.Focus()
Me.txtCurGL.SelectAll()
Return
End If
|
|
|
|