|
I ran into a problem inserting/updating images through a stored procedure, I think because of a limit to the size of data sent through a stored procedure parameter. To solve this problem, I execute inserts and updates directly, like this:
Public Function Insert(ByVal imageData As Byte(), ByVal imageType As String) As Integer<br />
Dim cmdText As String = "INSERT INTO MyImages(Image, ImageType) VALUES(@image, @imageType) SELECT SCOPE_IDENTITY()"<br />
Dim args(1) As SqlParameter<br />
args(0) = New SqlParameter("@image", imageData)<br />
args(1) = New SqlParameter("@imageType", imageType)<br />
<br />
Try<br />
Return CInt(SqlHelper.ExecuteScalar(ConnectionString, CommandType.Text, cmdText, args))<br />
Catch ex As SqlException<br />
' do error handling<br />
Throw<br />
End Try<br />
End Function
NOTE: I'm using the Microsoft Data Access Application Block[^] (SqlHelper) for data access.
|
|
|
|
|
I had the same problem with the stored proc & Oracle. You will have to do the insert directly, or use a SP to create the entry without the image data & then update the record with the image data.
|
|
|
|
|
I solved the problem adding a datacolumn, with formula qt*price, to the dataview.
Max
|
|
|
|
|
Hey..
I would like to use the internet transfer control, but when adding this code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Inet1.Protocol = icHTTP
Inet1.URL = Text1.Text
Inet1.Execute(, "GET")
End Sub
I get build errors saying that Inet1 is not declared...
I probably need to add some controls, but the problem is, I don't know from where? I can't find any control in the tool box or wherever that has anything to do with the internet transfer control?
Would appreciate some help here
|
|
|
|
|
You can add the internet transfer control by adding a reference to the msinet.ocx activex component. First, right click on the project name in solution explorer, and go to Add Reference -> COM -> Browse. Browse for MSINET.OCX, it should be in your system directory (usually c:\windows\system32 for winXP). .NET will automatically reference the object and create a managed wrapper class for it (in the form of AxCLASSNAME). You can then add this component into your project.
There are however, drawbacks to this. Wrapping an ActiveX control in .NET increases overhead. There are a few solutions built into .NET that come to mind.
1) The easiest solution uses the System.Net namespace and the HttpWebRequest and HttpWebResponse classes. You can use these classes to retrieve whatever document you wish using the HTTP protocol. For more information, see the HttpWebResponse class by navigating your VS.NET help to the following: ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemnethttpwebresponseclasstopic.htm
2) The second solutions gives you far more control by using sockets directly. By using the System.Net.Socket class, you can create to a remote host (port 80 is usually HTTP port), and the form a GET request using the HTTP protocol. This solution is not recommended because .NET has already built classes to handle http requests (solution #1). This class can be used for custom protocols.
- Joe
|
|
|
|
|
Is there a way that I could create multiple contols on a form using a loop?
for loopcounter = 1 to 10
dim strControlName as string = "Button"
dim objButton as new button()
objbutton.name = strControlName & loopcounter
form1.controls.add(objbutton)
next
Am I close?
Please help!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
you would need to make the controls globally available ( not just on a sub or command button ) and also you would have to account for setting the positions of each item, which could become a bit of a headache. can you not add the controls at design time? it would save you a lot of bother.
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
I was just wondering if it could be done, I realize that it would take some work to do the location of the controls. You said globally? Thanks!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
So - I want to expose the collection of print jobs (from the print queue) as a DataTable. Anyone have any experience (esp. code) I can draw on?
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I have an assembly file that I am importing with the statement
import assemblyfile
I am also including a reference to it in the solution explorer.
I create a variable of it but when I try to use it I get an error saying
"Error Loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config Request for the permission of type Systems.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version 1.0.3300.0, Culture=neutral, PublicKey Token=b77a5c561934e089 failed.(c:\windows\microsoft.net\framework\v1.0.3705\config\machine.config"
If anyone can point me in a direction on what I missed I would appreciate it.
Thanxs in advance
|
|
|
|
|
Hi I am trying to access a global assembly in the gac through a .net service. Right now I just have the code
Imports assemblynamehere
I keep getting the error that says
namespace or type 'eventlog' for imports assemblynamehere can not be found.
any help at all would be appreciated.
thanx
|
|
|
|
|
Add a reference to the assembly first.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
|
In the Solution Explorer, listed under your project there is a folder named references.
If you open this folder you will notice there are some entries in there like:
System
System.Windows.Forms
System.XML
These entries might be more or less, or different depending upon the type of project you are working on. These are the various assemblies that your application is using.
Right click on the project and select the 'Add Reference…' option.
This opens up a dialog box that lists all assemblies found in the GAC. Select your assembly from here, or browse to where it is stored. This will set the reference to the assembly that you want to use.
Now your Imports statement should work.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
That worked thanks much for the help
|
|
|
|
|
No problem...
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
What is the easiest way to associate a program app w/an icon? I've seen the MSDN website explaination, but it didn't work and the steps seemed really complicated. Does anyone know of any other methods that work? Thanks.
|
|
|
|
|
Which are your using, VB6 or VB.Net? Both are quite simple to do.
For VB6, the option you're looking for is located in the Project Options while in VB.Net it's it the Solution Options. Look for it, you can't miss it
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
I'm using embedded visual basic, developing apps for the pocketPC. Thanks for the response.
|
|
|
|
|
My scenario is where I would need to connect to a third party app's DLL VB interface with an XML listener. Basically the XML listener will be in the same box with the DLL and the VB interface calling that particular DLL. My difficulty is in getting the XML listener invoking the VB interface. How do I go about doing that? Thanks.
|
|
|
|
|
Hello everyone:
I'm creating a website where I need to display personalized information about my users (students) but I'm having a really bad time trying to get this done, because I don't really know too much about programming.
What I want it's to reuse the STUDENTID typed by the user at the login process to query the DB and show their respective data.
Student Login (StudentID & Pwd) >> goes to Welcome Page >> if they click in Attendance It should display that student's attendance.
Could someone, please, help me giving me at least an Idea of what I should do?!
I'm using VB.NET.
Thanks
ASP.NET Fan
|
|
|
|
|
Hi!
I have a problem with my program. It is a small game, in which the two players (user and computer) receive one point when winning. First to three points will win the whole game.
The problem is that after the players recieve their first point, and win again, they don't recieve any more points. What's the problem?
<br />
Dim V_DuVin As Boolean<br />
Dim V_DatVin As Boolean<br />
Dim V_DinPoang As Integer<br />
Dim V_DatPoang As Integer<br />
If V_DuVin = True Then<br />
V_DinPoang = V_DinPoang + 1<br />
Else If V_DatVin = True Then<br />
V_DatPoang = V_DatPoang + 1<br />
End If <br />
//OT
|
|
|
|
|
VB:
<font face="Courier New" size="2"><font color="blue">Dim</font> V_DuVin <font color="blue">As</font> Boolean<br><font color="blue">Dim</font> V_DatVin <font color="blue">As</font> Boolean<br><font color="blue">Dim</font> V_DinPoang <font color="blue">As</font> Integer<br><font color="blue">Dim</font> V_DatPoang <font color="blue">As</font> Integer<br><font color="#009999">'////BELOW WINDOWS GENERATED CODE AREA^^^^.</font><br><font color="blue">Private</font> <font color="blue">Sub</font> Button1_Click(ByVal sender <font color="blue">As</font> System.Object, ByVal e <font color="blue">As</font> System.EventArgs) Handles Button1.Click<br> V_DuVin = True<br><font color="blue">End</font> <font color="blue">Sub</font><br><br><font color="blue">Private</font> <font color="blue">Sub</font> Button2_Click(ByVal sender <font color="blue">As</font> System.Object, ByVal e <font color="blue">As</font> System.EventArgs) Handles Button2.Click<br>If V_DuVin = True Then<br> V_DinPoang = V_DinPoang + 1<br> ElseIf V_DatVin = True Then<br> V_DatPoang = V_DatPoang + 1<br> <font color="blue">End</font> If<br> MessageBox.Show(V_DinPoang)<br><font color="blue">End</font> <font color="blue">Sub</font></font>
you must have the items dimmed on a main part of the form , like just below the windows generated code , otherwise the values will reset each time if they are only declared in a sub.
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
Thanks. The problems are solved.
//OT
|
|
|
|
|
<br />
Dim V_DinPoang As Integer<br />
Dim V_DatPoang As Integer<br />
Check the scope of these variables. Make them Global or Static
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|