|
Hi
I know how to store the image in database but i want to know how to for example :
First Capture an image then allow the user to draw a line as in GRAPH x co ordinate & Y co ordinate on the image
and store this image in the oracle database
Pls help me.
Regards
Lion Heart
Software Engineer
Bangalore
|
|
|
|
|
I am writing a program that will have two purposes and need some guidance. The first purpose is for data entry of survey responses. All responses are numerical and must fall within a range specified for each question, so the input must be validated. For example, if the question is asking the height of the subject, then the response must fall between 48 inches and 84 inches. Is there a way for the program to read the limits from another source, say a file? The client wants to be able to change the limits very easily and I have a separate window that will display and allow them to change these limits for each question. How do I get the system to read these values and validate the responses?
The second purpose is to store the data in some fashion. Each person taking the survey is considered a 'subject'. Each subject will have a response to each of the 20 questions, so I would imagine that a database would work, creating a 'subject number' as a primary key. How would I go about doing this in VB? Is this the best way to go, or I am off the path here. The client would ideally like to see all of the subject data in an excel spreadsheet, so maybe I could go that way too. Any input would be greatly appreciated.
|
|
|
|
|
cheeseflea wrote:
Is there a way for the program to read the limits from another source, say a file?
You can write a generic validation function and then read the limits from a config file, yes. I'd assume the file would be XML, and would contain the questions with a node group for validation required.
cheeseflea wrote:
How do I get the system to read these values and validate the responses?
The easiest way to deal with data is XML, then you'll need to provide a UI to generate that XML and edit it.
cheeseflea wrote:
How would I go about doing this in VB? Is this the best way to go, or I am off the path here
Hmmm... if your set of questions is going to be large enough, perhaps a full on database solution is required. Either way, I'd be more inclined to offer editing of questions in your own UI, not via Excel.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I developed a small vb.net solution for a friend.
The system is going onto a shared hosting environment.
The last page consists of a small datagrid, some text boxes and a multipage datagrid at the bottom.
I need to print the last page and could not figure out how to do this with a multi page datagrid.
Therefore, I took the pagination off the datagrid so I in effect, created one large web page.
I have two problems.
The first problem is that the users need to set the printer to Landscape mode.
I would like to do this programmatically so they would only have to click the Print button on the browser.
The second problem happens when I try print the "Page".
The length of the datagrid is dynamic due to wordwrap and when I try to print the page,
sometimes the upper half of the last line on the page appears at the bottom of page 1
while the bottom half of the same line appears at the top of page 2.
The line is actually split horizontally.
Thanks for any help given,
Art Sterling
|
|
|
|
|
You can't control the client browser from ASP.NET. This would only be possible, if at all!, by client-side JavaScript in the page your sending. Though, I don't know how to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks,
I think I will just put a message telling the user to set the printer to Landscape mode.
|
|
|
|
|
i have two forms:
--------------
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fr As Form2
fr.test()
End Sub
End Class
---------------
Public Class Form2
Inherits System.Windows.Forms.Form
Sub test()
MsgBox("Hello")
End Sub
End Class
---------------
with this i have the error:
"An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
My question is: how i can acess from form1 to a sub or a function in form2. Putting "shared sub" it works but exists another way to make this?
waiting you help.
Thanks.
|
|
|
|
|
|
makeko wrote:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fr As Form2
fr.test()
End Sub
End Class
"An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
Your error occurs at fr.test() because you haven't created an instance of Form2. Change the line:
Dim fr As Form2
TO
Dim fr As New Form2
Now you should be able to access fr.test()
|
|
|
|
|
It works. But if form2 already exists and i want to put data on it.
Like this:
-----------------------------
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
Public Sub teste()<br />
TextBox1.Text = "Hello"<br />
End Sub<br />
<br />
Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim fr2 As New Form2<br />
fr2.Show()<br />
End Sub<br />
End Class
------------------------------
Public Class Form2<br />
Inherits System.Windows.Forms.Form<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim fr1 As Form1<br />
fr1.teste() ***<br />
End Sub<br />
End Class
------------------------------
*** ERROR: "An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
Without using "shared sub", i don't know how to put this working.
Waiting help...
Thanks.
|
|
|
|
|
makeko wrote:
Public Class Form2
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fr1 As Form1
fr1.teste() ***
End Sub
End Class
------------------------------
*** ERROR: "An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object."
You made the same error...but this time you did not create an instance of Form1 in the Form2 button event.
You had:
Dim fr1 As Form1<br />
fr1.teste() ***
Where you should have
Dim fr1 As New Form1<br />
fr1.teste() ***
Also, please take the time to read this article, it may help you with your situation.
http://www.devcity.net/Articles/94/multipleforms.aspx[^]
|
|
|
|
|
Ok, that work but with that the text on the textbox isn't modified, because is created a new instance and i have already one Form1 created and i want to change the text on texbox of this one.
If you can, try the code that I put here previously.
thanks for the help...
|
|
|
|
|
The reason why the textbox isn't modified, as you have said already, is because you are creating new instances of Form1 or Form2 in every button event. Is Form1 acting as a dialog box? If so, have you tried the InputBox class??
If you are trying to access a sub procedure inside a Form, you may want to consider using Events or as you have said before, a Shared method. But it really depends on what this "method" is trying to accomplish.
|
|
|
|
|
What i'm trying is:
I have 1 form ( form1 ) that when i click in a button open another form ( form2 ) with a datagrid where i can select one user with a keypress or a doubleclick. After that, the form2 closes automatically and i want that the data in the row selected on datagrid goes to textboxs in form1. I have the data in one dataset.
How you would decide this problem?
Can you tell me the better way to do that?
thanks for the help.
|
|
|
|
|
I would suggest using Events to perform what you would like to do. I posted a link earlier, but I'm assuming you haven't read it.
http://www.devcity.net/Articles/94/multipleforms.aspx[^]
Anyway, since you are not willing to read the link...here is some sample code:
In Form2 (the one with a Datagrid):
<br />
Public Class Form2<br />
Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
...<br />
#End Region<br />
<br />
'declare an event that can be caught in Form1 code<br />
'you can name this whatever you want<br />
Public Event OnRowDoubleClicked()<br />
<br />
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'databind your datagrid here or in design mode<br />
End Sub<br />
<br />
Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DoubleClick<br />
'This is if you want to close your window on a when <br />
'the user double clicks a row<br />
<br />
'raise the event to be caught in Form1<br />
RaiseEvent OnRowDoubleClicked()<br />
<br />
Me.Close()<br />
End Sub<br />
<br />
Private Sub Form2_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) _<br />
Handles MyBase.Closing<br />
'cancel closing of form<br />
e.Cancel = True<br />
'hide the form from the user<br />
Me.Hide()<br />
End Sub<br />
End Class<br />
Now in Form1 (the one with the Button and TextBox):
<br />
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
...<br />
#End Region<br />
<br />
'declare a Form2 with events - the key to handling the <br />
'doubleclick in Form2<br />
Private WithEvents f2 As Form2<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
'display the form to the user<br />
<br />
'check if Form2 has been created<br />
If Not f2 Is Nothing Then<br />
If Not f2.IsDisposed Then<br />
'display form if not disposed<br />
f2.ShowDialog()<br />
Else<br />
'create new instance of Form2<br />
f2 = New Form2<br />
f2.ShowDialog()<br />
End If<br />
Else<br />
'create new instance of Form2<br />
f2 = New Form2<br />
f2.ShowDialog()<br />
End If<br />
<br />
End Sub<br />
<br />
<br />
Private Sub f2_OnRowDoubleClicked() Handles f2.OnRowDoubleClicked<br />
'handle the double click event in the datagrid of Form2<br />
'now you can access the Datagrid information since it is a public control <br />
'in Form2...like so:<br />
TextBox1.Text = f2.DataGrid1....<br />
End Sub<br />
End Class<br />
It's up to you to figure out the rest...but I really do suggest you read the article that I linked!
A.S.
|
|
|
|
|
Thanks for everything.
It works very well.
Persons like you makes the codeproject big.
One more time, Thanks.
|
|
|
|
|
Can a tuple within a table hold a URL that points to a particular file, so that when a SELECT is made on that tuple it will open up the file itself?
|
|
|
|
|
SQL questions belong in the SQL Forum[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No, a SELECT is only going to select data, not realise it's a URL, let alone visit it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks in advance,
I have developed a small application in VB6.0 which prints on a predefined paper. As of now its printing fine on EPSON printer. But when i run the same application and printing on HP/Other printer its printing different.( i mean not in the defined areas). To say, if in EPSON, if its printing from left side, in HP its printing from right side and the print is totally outside my paper. How can i control this? Is it that some printers print from left side and some printers print from right side? How to achieve this through visual basic, no matter what the clients printer is.. it should print in the predefined areas. I will be looking forward for a reply. Thanks again
Electronic Screw
|
|
|
|
|
That's going to be a bit difficult to do. Since each printer has different "unprintable margins," it's virtually impossible to do what you want completely automatically.
For example, if a field is about an inch from the left edge of the page, the unprintable margin on one printer would probably be something like 1/8" and on another 3/16".
You'll have to put into your code some method for your fields to be laid out using offsets. These offsets would be stored in an .INI file and read by your program. Using these offsets, you're code could move the fields around so they fall into the pre-printed boxes on the form. You'll have to come up with the method for moving them around depending on how your laying them out now.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am running MSI installs from my program but because they use msiexec.exe and not the .msi file it is hard to know when they have finished.
I am trying to create a list of running processes and check if msiexec.exe is still running so then i will know when the install has finished.
Can anyone help on this?
Thanks Oli
|
|
|
|
|
Msiexec returns a code that indicates success or error information. If msiexec returns a zero the setup has finished successfully. But there is a whole page of codes that can be returned. You should download the Windows Installer documentation from MS to get the more information.
|
|
|
|
|
How can i monitor the msiexec for an exit code after i have ran the msi exe?
Thanks
Oli
|
|
|
|
|
Try
Dim ExitCode As Integer
Dim si As New ProcessStartInfo()
si.FileName = "msiexec"
'Add install switch and quotes to msi path
si.Arguments = " /i " & """" & strMSIPath & """"
Dim proc As Process = Process.Start(si)
proc.WaitForExit()
ExitCode = proc.ExitCode
Catch ex As Exception
'All real exit codes are >= 0
ExitCode = -1
End Try
'Evaluate Exit Code ....
|
|
|
|