 |
|
 |
|
Next: Expanation?
|
| Author |
Message |
External

Since: Sep 16, 2004 Posts: 22
|
(Msg. 1) Posted: Sat Feb 12, 2005 4:53 am
Post subject: Passing Var's to Procedure Archived from groups: microsoft>public>vb>database (more info?)
|
|
|
what should I change in the procedure below that I can call it with more
variables...(i,e)
File2SqlBlob("c:\pic1.jpg","tablename","colname")
I am having problem defining the variables within the procedure ..thank you
for help
Private Sub File2SqlBlob(ByVal SourceFilePath As String)
Dim cn As New SqlConnection("server=localhost;integrated
security=yes;database=NorthWind")
Dim cmd As New SqlCommand("UPDATE Categories SET Picture=@Picture WHERE
CategoryName='Test'", cn)
Dim fs As New System.IO.FileStream(SourceFilePath, IO.FileMode.Open,
IO.FileAccess.Read)
Dim b(fs.Length() - 1) As Byte
fs.Read(b, 0, b.Length)
fs.Close()
Dim P As New SqlParameter("@Picture", SqlDbType.Image, b.Length,
ParameterDirection.Input, False, 0, 0, Nothing, DataRowVersion.Current, b)
cmd.Parameters.Add(P)
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
End Sub >> Stay informed about: Passing Var's to Procedure |
|
| Back to top |
|
 |  |
External

Since: Mar 14, 2004 Posts: 1626
|
(Msg. 2) Posted: Sat Feb 12, 2005 8:35 am
Post subject: Re: Passing Var's to Procedure [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
WIthout knowing how tablename and colname are to be used in your procedure,
it's difficult to say.
However, your code appears to be VB.Net, and this newsgroup is intend for
questions related to "ClassicVB" only (VB6 and earlier). The .Net groups all
have dotnet in their names.
--
Doug Steele, Microsoft Access MVP
<a rel="nofollow" style='text-decoration: none;' href="http://I.Am/DougSteele" target="_blank">http://I.Am/DougSteele</a>
(no e-mails, please!)
"Ben" wrote in message
> what should I change in the procedure below that I can call it with more
> variables...(i,e)
> File2SqlBlob("c:\pic1.jpg","tablename","colname")
> I am having problem defining the variables within the procedure ..thank
> you
> for help
>
>
>
> Private Sub File2SqlBlob(ByVal SourceFilePath As String)
> Dim cn As New SqlConnection("server=localhost;integrated
> security=yes;database=NorthWind")
> CategoryName='Test'", cn)
> Dim fs As New System.IO.FileStream(SourceFilePath, IO.FileMode.Open,
> IO.FileAccess.Read)
> Dim b(fs.Length() - 1) As Byte
> fs.Read(b, 0, b.Length)
> fs.Close()
> ParameterDirection.Input, False, 0, 0, Nothing, DataRowVersion.Current, b)
> cmd.Parameters.Add(P)
> cn.Open()
> cmd.ExecuteNonQuery()
> cn.Close()
> End Sub
>
>
> >> Stay informed about: Passing Var's to Procedure |
|
| Back to top |
|
 |  |
| Related Topics: | sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...
arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!
DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all
Possible Use of a Cursor - I have a complex query that I hope I can explain it well enough for everyone to understand. I have a table that contains information for work instructions. Contained in the table are "MACHINE_PROC" these are groupings of machining processes....
Scroll Bars - Is there a way to find the size of scrollbars on a system using Visual Basic 6.0? I know how to look and change them on the display properties, but I don't know how to access that information from within Visual Basic. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|