|
I already view the picture in picturebox but when i click save button, it doesn't work. Something wrong with my coding. Below is my current program code!!!
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click<br />
Dim SQLHelper As New SQL<br />
Dim tmpAFOS As String<br />
tmpAFOS = cboAFOS.SelectedText<br />
Select Case tmpBOS<br />
Case rrdoAF.Text : tmpRank = cboPAF.Text<br />
Case rrdoNA.Text<br />
tmpRank = "N/A"<br />
tmpAFOS = "N/A"<br />
Case rrdoNP.Text : tmpRank = cboPNP.Text<br />
Case rrdoPM.Text : tmpRank = cboPM.Text<br />
Case rdoPA.Text : tmpRank = cboPA.Text<br />
Case rdoPN.Text : tmpRank = cboPN.Text<br />
End Select<br />
<br />
Dim USERParameters(16) As SqlClient.SqlParameter<br />
USERParameters(0) = New SqlClient.SqlParameter("@last_name", txtLastName.Text)<br />
USERParameters(1) = New SqlClient.SqlParameter("@first_name", txtFirstName.Text)<br />
USERParameters(2) = New SqlClient.SqlParameter("@middle_name", txtMiddleName.Text)<br />
USERParameters(3) = New SqlClient.SqlParameter("@rank", tmpRank)<br />
USERParameters(4) = New SqlClient.SqlParameter("@serial_number", txtSerial.Text)<br />
USERParameters(5) = New SqlClient.SqlParameter("@afos", tmpAFOS)<br />
USERParameters(6) = New SqlClient.SqlParameter("@branch_of_service", tmpBOS)<br />
USERParameters(7) = New SqlClient.SqlParameter("@group_id", 1)<br />
USERParameters(8) = New SqlClient.SqlParameter("@status", "For Approval")<br />
USERParameters(9) = New SqlClient.SqlParameter("@birth_date", dtpBirthDate.Value)<br />
USERParameters(10) = New SqlClient.SqlParameter("@phone", txtPhone.Text)<br />
USERParameters(11) = New SqlClient.SqlParameter("@address", txtAddress.Text)<br />
USERParameters(12) = New SqlClient.SqlParameter("@email", txtEmail.Text)<br />
USERParameters(13) = New SqlClient.SqlParameter("@maxallowed", 1)<br />
USERParameters(14) = New SqlClient.SqlParameter("@registered_by", "")<br />
USERParameters(15) = New SqlClient.SqlParameter("@password", txtPassword.Text)<br />
Dim nStr As String = Me.Label23.Text.Substring(Me.Label23.Text.LastIndexOf("\") + 1)<br />
USERParameters(16) = New SqlClient.SqlParameter("@fname", sqldbtype.nvarchar).value=nstr<br />
<br />
Dim ms As New MemoryStream<br />
Me.PictureBox1.Image.Save(ms, Me.PictureBox1.Image.RawFormat)<br />
Dim arrayImage() As Byte = ms.GetBuffer<br />
ms.Close() ' Closes the Memory Stream<br />
<br />
USERParameters(17) = New SqlClient.SqlParameter("@pic", SqlDbType.Image).Value = arrayImage<br />
Dim result = SQLHelper.ExecuteQueryString("usp_users_insert", USERParameters)<br />
<br />
If result <> "" Then<br />
'MessageBox.Show("Image Saved Into the DataBase")<br />
MessageBox.Show("TRANSACTION COMPLETED:" + vbCrLf + "You have successfully submitted your registration details." + vbCrLf + "Your user id is : " + Integer.Parse(result).ToString("0000"), "Transaction Error", MessageBoxButtons.OK, MessageBoxIcon.Information)<br />
Else<br />
MessageBox.Show("TRANSACTION ERROR:" + vbCrLf + "The system is unable to process your request. Please try again later or contact the librarian.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)<br />
End If<br />
If GlobalProgramLevel = "LIBRARIAN" Then<br />
frmLibrarianModule.Show()<br />
Else<br />
frmUserLogInModule.Show()<br />
End If<br />
Me.Hide()<br />
End Sub
|
|
|
|
|
Hi all,
I am using MS ACCESS database for my applicaion, in that i have an field to store system time and it's datatype is datetime.
When i store an record it stores correctly like this 4:24:16 PM. But whn i retrive the record in my application, the data retrived as 12/30/1899 12:00:00 AM.
My question is I want to compare this time with my current system time, for this i want to remove the date. I used convert() function, but this supports only sql not in MS ACCESS.
Plz any one kindly help me.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
|
More of a discussion topic than a question. Thought of posting this in the lounge but decided to save myself from getting flamed
I got this[^] (as I'm sure most of you have as well) with the regular MSDN Flash newsletter & was a bit puzzled by the idea of implicitly typed local variables. It looks like an interesting idea but to my mind it may be opening a whole huge door for bugs. Although this kind of type inference saves a few key strokes & has advantages in preventing late binding is it really worth it? I dunno.
The rest of the article is pretty cool & I'm looking forward to playing with some of the features but I can't seem to wrap my head around this type inference thing (in that I think it'll allow newbies to create software of a poorer quality).
Am I wrong? Why am I wrong?
|
|
|
|
|
It is still strongly typed. If you initially create the variable as an integer, you cannot later store a string in there - the compiler won't let you. The scope is limited to the local method. Also, the benefit is more in being able to store anonymous types than anything else. After all, what would you define a variable as for an anonymous type?
|
|
|
|
|
hi i want to captures pictures and their croping and saving into databse . i am unable to connect first my webcame with my application please tell me any Active X control or other way to complete it thanks
Regards
Msaqlain
|
|
|
|
|
I need to create a light weight Questionpaper Application in .Net, which a user can download from web.
After installation, the application should contact my webserver to fetch questions and display to the user and at the end of
the test, all the user responses need to be saved to my database online. Can someone advise what .NET technology I should
use to get this accomplished?
D.Willington
|
|
|
|
|
One post is enough.
you can try with the Asp.Net technology.
For more details log on to Asp.Net[^]
Regards,
Satips.
|
|
|
|
|
What you are describing is a Windows application as client that connects to a server application. I would suggest that you instead make a web application so that you use a browser as client. That way the user doesn't have to install anything, .NET framework is not required on the client, and the client doesn't even have to use Windows.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
BTW please use same thread for the discussion it is just waste to create a new thread for the discussion of the same problem.
One post is enough.
Regards,
Satips.
|
|
|
|
|
Does anyone have sime codes to apply custom formatting to Dates (specifically Now()). I have a need to write different parts of the current date, including the time as YYYYmmDD as well as HHMM. The way we did it in VB 6 is not effective in VB .net 2005. Please help! TIA
|
|
|
|
|
Check out Formatting Date & Time in .Net[^]
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
FYI: I found some useful help at the address below. Basically, by using the code below, I was able accomplsh my mission.
(Format(Now, "yyyy") & (Format(Now, "MM") & Format(Now, "dd")))
http://msconline.maconstate.edu/tutorials/VBNET/VBNET01/vbnet01
|
|
|
|
|
You can actually get that in one step:
How about this:
Dim currTime as DateTime = DateTime.Now
MessageBox.Show(String.Format("{0:yyyyMMdd}", currTime)
Alternatively:
MessageBox.Show(currTime.ToString("yyyyMMdd"))
No need to go the route you've chosen above.
------------
Cheers,
Patrick
|
|
|
|
|
I need to make a quick RSS Reader. Can anyone help me with code or where to get the code I would greatly appreciate it.
|
|
|
|
|
pronk4prez,
Try reading this article[^] on creating a RSS Reader.
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
Hi,
Have an look on this Reader.
Hook Reader
Download the Rss reader. It's really nice one. You can have an look on it and get some ideas
Know is Drop, Unknown is Ocean
|
|
|
|
|
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Clrtest\Clrtest\Test Scripts\mFunctions.vb(904) : warning BC42016: Implicit conversion from 'Object' to 'Date'.
Clrtest -> C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Clrtest\Clrtest\bin\Clrtest.dll
Error: Column, parameter, or variable #1: Cannot find data type GL_Record.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Public Class GL_Record
Public AccountNo As String = ""
Public AccountField As String = ""
Public Year As Integer = 0
Public Month As Integer = 0
Public YTD As Decimal = 0
Public MTD As Decimal = 0
Public LastTransAmount As Decimal
Public LastTransDate As Date = "01/01/01"
Public LastTransBy As String = ""
Public LastEffectiveDate As Date = "01/01/01"
Public NumberOfTrans As Long = 0
End Class
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub sbSetupGLProbe(ByVal Selections As StoredProcedures.GL_Record)
Dim stDocName As String
Dim result As Long = 0
Try
sbBuildGLQuery(Selections)
stDocName = "rptGL_Probe"
Catch
fnHandleError("sbSetupGLProbe")
End Try
Exit Sub
End Sub
Help!!
|
|
|
|
|
Need to display current time on form in vb.net
|
|
|
|
|
Using a label do
<br />
Label1.Text = System.DateTime.Now<br />
To use different formats look up Formatting Date Time Values in .Net
" In the next millennium there are two kinds of business, those on the Internet and those out of business"
Bill Gates
"Be nice to nerds. Chances are you'll end up working for one."
Bill Gates
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
What is a label do?
Do a create a label or textbox?
|
|
|
|
|
If you cannot understand this answer, you should buy a book on VB.NET and work through it, so you learn the language before you start playing with the IDE.
He's saying use a label and do what the code sample is showing you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian,
A lot big ideas; however, I didn't see you jump in and answer the so called "easy question".
Maybe you need to pickup the book yourself instead firing off sarcasm.
|
|
|
|
|
cwoods56,
A label[^] is a control you drag and drop onto your form. Chris wasn't being sarcastic, he was simply stating that my answer was in its most basic form and if you dont know what a label is you truly need to read about VB.Net before asking questions (as knowing the controls is the very primitive basics of working with VB.Net)
|
|
|
|