|
You can use as folllowing
1- get the path using Open file dialogue in text box as I taken in txtCompanyLogo.text
2-
Dim arr() As Byte
If Trim(txtCompanyLogo.Text) <> "" Then
FileOpen(1, txtCompanyLogo.Text, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
'Resize array so that it can accomodate the file
ReDim arr(FileLen(txtCompanyLogo.Text) - 1)
FileGet(1, arr)
FileClose(1)
'/////// Ds is DataSet & CompanyInfo is TableName & CompanyLogo is Field Name for Binary Data ////////////
ds.Tables("CompanyInfo").Rows(0).Item("CompanyLogo") = arr
End If
Enjoy Solution
|
|
|
|
|
Hello,
I used to display binary image in VB 6.0 using the following code:
<br />
<br />
dim byteImage() as byte<br />
' assuming byteImage() has value display the image using PICTUREBOX object<br />
picturebox1.image.hpal = byteImage<br />
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB6.0?
|
|
|
|
|
I'm sorry about that last line:
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB6.0?
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB.NET?
|
|
|
|
|
check this
http://www.vbdotnetheaven.com/UploadFile/mahesh/BLOBinAdoDotNet04232005065613AM/BLOBinAdoDotNet.aspx?ArticleID=61566715-97c5-47cd-a8d4-d254cb8309cd
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
|
I'm sorry about that last line:<br />
<br />
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB6.0?<br />
<br />
This procedure seems to be not supported by VB.net, anybody has an know/idea on how will I do this in VB.NET?
i thing he searched in vb.net
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
i am getting above error while trying to do following.. i tried hard but dont know what went wrong,
=========
'##############
'check for existance of userID in database
Function CheckUserName(ByVal userID As String) As DataSet
objConn = New SqlConnection(dbPath)
cmd = New SqlCommand("select username from userPersonalDetails where username='" & Replace(txtUserName.Text, "'", "''") & "'", objConn)
Dim dataAdapter As SqlDataAdapter = New SqlDataAdapter
dataAdapter.SelectCommand = cmd
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
'check for existance of users email address in database
Function CheckEmail(ByVal email As String) As DataSet
objConn = New SqlConnection(dbPath)
cmd = New SqlCommand("select emailaddress from userPersonalDetails where emailaddress='" & Replace(txtEmail.Text, "'", "''") & "'", objConn)
Dim dataAdapter As SqlDataAdapter = New SqlDataAdapter
dataAdapter.SelectCommand = cmd
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
Return dataSet
End Function
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If Page.IsValid Then
Dim userDS As New DataSet
userDS = CheckUserName(txtUserName.Text)
Dim emailDS As New DataSet
emailDS = CheckEmail(txtEmail.Text)
If userDS.Tables(0).Rows.Count = 1 Then
'userid exists so display a message
lblMsg.Text = "That UserID Exists. Please Pick Another"
ElseIf emailDS.Tables(0).Rows.Count = 1 Then
'email address exists so display a message
lblMsg.Text = "Someone has registered with that Email address."
Else
cmd = New SqlCommand("insert into userPersonalDetails values('" & Replace(txtUserName.Text, "'", "''") & _
"','" & Replace(txtPassword.Text, "'", "''") & _
"','" & Replace(txtEmail.Text, "'", "''") & _
"','" & Replace(txtFullName.Text, "'", "''") & _
"','" & Replace(txtMobPhone.Text, "'", "''") & _
"','" & Replace(txtHomePhone.Text, "'", "''") & _
"','" & Replace(txtWorkPhone.Text, "'", "''") & "',0);", objConn)
objConn.Open()
cmd.ExecuteNonQuery()
'Response.Write(cmd.CommandText)
objConn.Close()
end if
end if
end sub
many many thanks in forward
robin
|
|
|
|
|
What line does the error show up on?!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
please disregard this post in my aspx page the label was not created but in my vb it was declared so it was complaining about lblmsg sorry thanks for your help.
|
|
|
|
|
A few suggestions, in no particular order.
1) If you asre getting an exception in code, you have done the right thing by showing us the code, however you have not indicated where, in this code, the exception is being raised.
That said, the good ol' "Object reference not set to an instance of an object" exception is the most cut-and-dry there is. It means that somewhere you have tried to access a property or method of an object without first instantiating the object.
A quick scan shows: objConn.Open() is called, but that object has not (as far as I can tell) been instantiated.
2) You should not be creating your SQL Queries in this way - read about Sql Injection attacks[^] for more info. Also note that using ADO.NET parameters would remove the need to keep calling that Replace(textfield,"'","''") hack.
3) Using separate queries for looking up a username and an email address is unnecessary network overhead. Using a dataset to retrieve just one value is unnecessary local overhead. A better way would be a) Use one query to determine if username OR email exists in the db and simply return a boolean(or single value indicating problem if you require) b) Use the command's ExecuteScalar[^] method to return a single value, rather than a dataset, which should be used when you really do need a disconnected table on the client.
-- modified at 8:36 Tuesday 14th March, 2006
|
|
|
|
|
Hi!
Can you please explain me what do you mean by objConn.open hasn't been instanciated.
on the top of the page i had
'declaring global db connections
Dim query As String
Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader
Dim dbPath As String = CType(configurationAppSettings.GetValue("sqlConnection1.ConnectionString", GetType(System.String)), String)
Dim dr As SqlDataReader
Dim objConn As SqlConnection
Dim cmd As SqlCommand
which wasn't there in my code. please correct me if i am wrong in anyway and i really appreciate for giving me valuable suggestions.
thanks once again.
|
|
|
|
|
I create 3 Textbox put in to a form (Form Name : Find) Tab order is 0 ,1 ,2.
I take MDI application. Then select the menu using keyboard Example( Alt E) then
select find menu Then PressEnter key. The "Find" form is open. To automatically
call the First Textbox keyup Event. How can I stop this firing.
Continue...
|
|
|
|
|
I answered your previous question. Did it work?
chatura
|
|
|
|
|
hi every one there i am new and i am also very new student studying vb 6.0.
i have a problem and i hope to get help from you all.
my master says me to create a login form where it can accept many users but all users have no equal rights. some have only read right and others they have some administrative rights and also one will have all the rights to do what ever he wants to do.
i am in confusion with this users, "i actually only knows two users i.e. Administrator and the Ordinary users.". Help me if theres a way i can help to create this program using vb 6.0.
There i should also have the database to keep the data of the users.
please help me, i have to do it by any means.
Thanks you will wait for the reply.
DrAlHa
|
|
|
|
|
Hi to all,
I'm still developing to a softphone, that when receive an incoming call play a ring sound from sound card and also (together the ring sound) play a "beep" from pc speaker. Now, I have done the first part using PlaySound API function that play in loop a wave file asyncronously, but I can't play the 'beep' from pc speaker. For this, I have already used the beep API function, but it is synchronous!
How can I do?
Thanks a lot
|
|
|
|
|
|
I try to see in this site but nothing...
However I'm still thinking that is impossible make the pc speaker beep asynchronous..
|
|
|
|
|
Hi!
I made a program to collecting (and uploading to a mysql database) drive informations (volume name, serial, size,...) every 10 minutes. I wrote it with scripting.drives. It works fine.
I have rewrite it to a windows service.
My problem is: the service can't see my attached network drives.
It is very important for me to see every drive.
I have no idea what is the problem... ;(
Please somebody help me!
Thank You!
LD
-- modified at 2:35 Tuesday 14th March, 2006
|
|
|
|
|
check this
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2267&lngWId=10
http://www.geekpedia.com/tutorial136_DriveStat-Listing-drives-and-using-pie-charts.html
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
|
I think Your right, this is the problem, but how can I solve it?
Or: how can I write a windows [console] application without a window. (so it will run in the background, and I can see it only in the task manager)
DL
-- modified at 3:09 Saturday 18th March, 2006
|
|
|
|
|
i failed to implement "Find next" of notepad....
Can u help me pllllz.
thanks in advance
|
|
|
|
|
|
plz i make database form in vb6 programe but i went the code to serch any name in the file
plz help me
feras
|
|
|
|
|
Help? WIth what? This isn't enough to help you do anything!
Help with connecting to the database? With putting a query together? With executing the query? With the result set????
A lot more detail is needed if you want any kind of a useful answer.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|