Much love x Thanks man! (y)
Brad
Posts
-
Want to inherit one property to another -
Want to inherit one property to anotherHi, I need to inherit my Form2 to Form3, when i use 'Inherits Form2' my form3 doesnt show up and I get this error message and I cannot view my Form3 design at all!
Warning 1 The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: Form3 --- The base class 'WindowsApplication1.Form2' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. 0 0
All i want to do is use some text out of a textbox in form2 and display it in a label on form3 Many thanks, Brad -
Only download if newer version available?How can I set my program to only download if a newer version is available? My program right now is set to download a file from my site every time it opens but I dont want it to do that. I would like to only download the file if the time and data has changed in the FTP?
-
Help with OLEDB error [modified]Thank you so much!!! I cant believe it was something that simple!!! Cheers again!
-
Help with OLEDB error [modified]Hi, I added the extra AND and here is the error what I am getting now!
Syntax error in string in query expression 'USERID='Brad' AND PASSID='test' AND HARDWAREID='BRAD-8EYRYEUOH4'.
The exception is on this line of code in my source:Dim dr As OleDbDataReader = cmd.ExecuteReader
Thanks
-
Help with OLEDB error [modified]Hi, I am coding a login which involoves database verification. For extra security I added a new column to my database and added the extra code accordingly and I am getting this exception..
System.Data.OleDb.OleDbException was unhandled ErrorCode=-2147217900 Message="Syntax error (missing operator) in query expression 'USERID='Brad' PASSID='test'' AND HardwareID='BRAD-8EYRYEUOH4'." Source="Microsoft JET Database Engine"
Here is the source for my project:Imports System.Data Imports System.Data.OleDb Public Class Form1 Dim mypath = "C:\Temp\mydb.mdb" Dim mypassword = "" Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mypath & ";Jet OLEDB:Database Password=abc123" & mypassword) Dim cmd As OleDbCommand Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sql = "SELECT UserID ,PassID, HardwareID FROM MYTAB WHERE USERID='" & TextBox1.Text & "' PASSID='" & TextBox2.Text & "' AND HardwareID='" & TextBox3.Text cmd = New OleDbCommand(sql, conn) conn.Open() Dim dr As OleDbDataReader = cmd.ExecuteReader Try If dr.Read = False Then MessageBox.Show("Authentication failed...") Else MessageBox.Show("Login successfully...") End If Catch ex As Exception MsgBox(ex.Message) End Try conn.Close() End Sub
I am completly stumped and dont understand what I have done wrong? Teh code was working fine until I added this extra bit in: HardwareID='" & TextBox3.Text Many Thanks -- modified at 20:44 Thursday 18th October, 2007 -
VB Login Form connect to a DBHi, I am creating a login for a project at college and I really do have no clue where to start. My brief is that I need to access a database for login purposes and set groups for permisions to access different areas in my program. I looked at this source http://www.codeproject.com/vb/net/Login\_Control.asp but when opening I got errors so i couldnt see the structure of the code. Any links etc would be really appreciated. Thanks.
-
textbox to a .txtMy.Computer.FileSystem.WriteAllText("C:\filename.txt", TextBox1.Text, True) That is how I have done it! Thanks for the help Christian!
-
textbox to a .txtVB keeps on thrwoing expression errors when i use your code and havw tried to work around it to get it to work but no luck. Please excuse my stupidness as i have been coding for a few months.
-
textbox to a .txtVB kep throwing expression errors, i have tried to work around it but it is not working at all, I am 18 and been coding for a few months so please excuse my stupidness.
-
textbox to a .txtHi Christian, At the moment i acually have no code for what i want to do as i have been trailing and erroring for a few hours now but here is screenshot of my design and the code for the form so far. 'button3' is what i want to actually save me file, as of the above posts i want to edit the textboxes and then save/overwrite teh existing file that it is reading from. Hope this helps you out with helping me. [IMG]http://i124.photobucket.com/albums/p14/Br4dZ/code.jpg\[/IMG\] Thanks again
-
textbox to a .txtHi, thanks for teh reply, i still cannot get it to work. Any more ideas or anything specific to know. Thanks
-
textbox to a .txtHi guys, the name pretty much says it all, I am as far as savedialogfile but i am completly stuck. My aim is to save a .txt from a textbox with a button. Thanks in advance, Brad
-
Help with StreamReaderJUNETY or anyone else, i have just had to format my pc and when i load up VS05 and my code i keep getting this error when debuging it, i have looked everywhere but it is really baffling me! any help will be appreciated!
Dim username1 As New IO.StreamReader("C:\username.txt") Dim password1 As New IO.StreamReader("C:\password.txt") Dim adminun As New IO.StreamReader("C:\adminun.txt") Dim adminpw As New IO.StreamReader("C:\adminpw.txt") Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click Do While username1.EndOfStream If username1.ReadLine() = Username.Text.ToString & Password.Text.ToString Then Exit Do End If Loop username1.Close() Do While password1.EndOfStream If username1.ReadLine() = Username.Text.ToString & Password.Text.ToString Then Exit Do End If Loop password1.Close() End Sub
ERROR:System.ObjectDisposedException was unhandled Message="Cannot read from a closed TextReader." ObjectName="" Source="mscorlib" StackTrace: at System.IO.__Error.ReaderClosed() at System.IO.StreamReader.get_EndOfStream() at WindowsApplication1.Form1.Login_Click(Object sender, EventArgs e) in C:\Users\Brad\Documents\Visual Studio 2005\Projects\SC Login\SC Login\Form1.vb:line 9 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(I
-
Help with StreamReaderPerfect....Cheers
-
Help with StreamReaderI added in your code and i seen to be getting this error under the "Username.EndOfReader" 'EndofReader is not a members of the windows.form.textbox' Another expection i am getting is the "exit loop" is thrwoing an exception, 'exit must be followed by sub, function, property etc etc etc' I have tried to play about with it but still struggling with working it out.
-
Help with StreamReaderBeen coding for about 3 months now and am currently making a "login" client for myself. I hve created a streamreader and have linked it to a .txt file which is located on my hardrive and i am struggling to get it to read of multiple lines so i can have more than one user. This is the code i have at the moment
Public Class Form1 Dim webe As New ProcessStartInfo() Dim username1 As New IO.StreamReader("C:\Textfile.txt") Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click If Username.Text & Password.Text = username1.ReadToEnd & "lol" Or Username.Text & Password.Text = "Admin" & "admin" Then StatusStrip.Text = "Welcome " & Username.Text
Thanks In Advance