|
hellow to all ..
can anybody tell me what's wrong with this insert statment
i recive Syntax error message ...
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Then
MessageBox.Show("Fill in all the fields")
Else
Dim ConnString As String
ConnString = "provider=microsoft.jet.oledb.4.0;data source=C:\Message.mdb"
Dim MyOledbCommand As OleDbCommand = New OleDbCommand
Dim OleDbConn As OleDbConnection = New OleDbConnection(ConnString)
OleDbConn.Open()
Dim String1, String2, String3, String4 As String
Dim u_date As String
String1 = TextBox1.Text
String2 = TextBox2.Text
String3 = TextBox3.Text
String4 = TextBox4.Text
String5 = Date.Today
Try
MyOledbCommand.CommandText = "Insert Into User " _
& "(user_name,password,first_name,last_name,u_date) " _
& "Values (" & "'" & String1 & "', " & "'" & String2 & "', " & "'" & String3 & "', " & "'" & String4 & "', " & "'" & String5 & "')"
MessageBox.Show(MyOledbCommand.CommandText)
MyOledbCommand.Connection = OleDbConn
MyOledbCommand.ExecuteNonQuery()
OleDbConn.Close()
MessageBox.Show("User was added")
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
Catch err As System.Exception
MessageBox.Show(err.Message)
End Try
End If
|
|
|
|
|
I used Matthew Hazlett bitblt code for vb.net and got it to work for part of what I wanted to do.
I have one picturebox which is my tileset holder. 32x32 tiles in size.
I have another picture box to hold the tile I clicked on(That part worked.)
Now I have a third picture box that is my map. I want to be able to click anywhere on picturebox3 and past the picture 32x32 in size from the second picturebox where I clicked.
The only thing I have got it to do is past it at 0,0 in the third picture box. I tired changeing numbers around and still nothing.
|
|
|
|
|
hellow to all
i wana add to my project a new form but i wana this form to be the first to load not the second one ...
how can i do it ?
thx to all ..
|
|
|
|
|
You have to change the startup object of your application:
Menu >> Project >> [ProjectName] Properties >> Startup object
|
|
|
|
|
|
ur welkum
|
|
|
|
|
Hi all, im a novice programmer. I was wondering how I could get a Folder Treeview with checkboxes (VB6). More specifically, I want to feed an array of directories (paths) to a treeview with checkboxes. These directories would be the highest level in the treeview (ie when collapsed, the only items or nodes would be the list from the array of directories).
The purpose of this is so that I can exclude or include (with checkboxes) subfolders for the purpose of copying files en-mass (a lot a time).
Ive seen examples of this from http://btmtz.mvps.org/treeview/ but as I am a novice programmer, I have difficulty in implementing... any help would be appreciated.
|
|
|
|
|
I need help i am trying to creat a program in VB.net for a pda.
i already have the database created using the quary analizer.
but i can not get the connection to work.
Public Sub conn()
Dim conn As New SqlCeConnection
conn.ConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; Data Source=\My Documents\abook.sdf;"
end sub
but i keep getting exceptions
i have searched threw several examples but they all start out by creating the database or using XML.
all i want is to retrieve data and manipulate it.
please some one explane what i am doing wrong, and a good example of what i need to do.
|
|
|
|
|
I have a scanned image which has two small circles in it. One is black colored another is white , in a picture box. I want to read the specific rgb of the two circles and represent the name black and white in two labels in a form.
Pls help me
|
|
|
|
|
Im a beginner in VB.net. Im was about to create a text log file to record my application activity such as the user update or delete something then such activity will be recorded in text file. I have this code from code project last time:
Private Shared Sub WriteToAppLog( _<br />
ByVal message As String _<br />
, ByVal messageType As EventLogEntryType _<br />
)<br />
Dim elLog As System.Diagnostics.EventLog<br />
Try<br />
elLog = New System.Diagnostics.EventLog( _<br />
"Application" _<br />
, Environment.MachineName _<br />
, Application.ProductName _<br />
)<br />
elLog.WriteEntry(message, messageType)<br />
Catch ex As Exception<br />
'Your error handling here<br />
End Try<br />
End Sub
But im not really understand how to implement it and where i can check the log file from above code? Does it appear to be .txt file? and does above code have to be placed in every form in my vb.net? If u have any other code than above, feel free to tell me.
Please help me, this is my last step of my project.
Thanks.
|
|
|
|
|
hello world,,,
can any one help me plis.. with this...
1- how can send messages anom.,. the code pls,,, i try with other programs,, y want the code,,, simple as that
2- how capture the incoming message,,, in a label or a text box,,,,
thanks a lot
jam
|
|
|
|
|
Goal: I need to use Windows Groups to determine access to certain
controls on an intranet web app.
Specs:
1. I can only use Windows Authentication.
2. IIS6.
What I have done so far:
1. I have an application already in use that uses Windows
Authentication.
2. I added two new groups each with users to my local machine.
3. I added this code in the web.Config:
<identity impersonate="true">
<authentication mode="Windows">
<authorization>
<allow roles="WORK\Administrators">
<allow roles="LOCAL\Administrators">
<allow roles="LOCAL\Basic">
<allow roles="LOCAL\Master">
<deny users="*">
4. I have this code in the code-behind of my start page:
Dim authUserName As String
authUserName = User.Identity.Name.ToUpper.Trim
Session("Username") = authUserName
If Principal.WindowsIdentity.GetCurrent.IsAuthenticated
Then
Server.Transfer("main.aspx")
End If
Questions:
1. How can I determine the Group name of the user when they log in?
2. How can I set up my local machine to test my program?
|
|
|
|
|
Hello i am currently executeing a program though VB . Net with the following code
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("c:\file.exe")
startInfo.CreateNoWindow = True
startInfo.WindowStyle = ProcessWindowStyle.Minimized
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit()
Is there a way i can make it halt the script untill the process has finished installing etc then it carrys on.
Also is it possible to create progress bars for files i am executing with the following code above?
Thanks
Oliver
|
|
|
|
|
phraser wrote:
Is there a way i can make it halt the script untill the process has finished installing etc then it carrys on.
You're already doing it.
pStart.Start().WaitForExit()
If your code doesn't block and wait for the process to exit, it means that the process you started already has exited. I take it you're launching some kind of shell .EXE and it is doing a Windows Installer installation (MSI file)? This will cause you great difficulty because the process you launch quits before the MSI is done installing. Since you can only have one MSI install going at a time, you can write a function to mointor a Process list for "msiexec". When all of the "msiexec" processes have finished, you can be reasonably sure that the installation is complete.
phraser wrote:
Also is it possible to create progress bars for files i am executing with the following code above?
No. Since the processes you're launching don't report back any kind of progress, you can't make a 0% to 100% ProgressBar. You can, however, make a non-progress ProgressBar. Confused? This is simply a bar that scrolls endlessly, indicating something is going on. Like the White/Blue/Black bar on the Windows 2000 title screen that scrolls acrossed the windth of the screen when 2000 boots. XP has a little green box scroller during installation and another scroller when it boots on its title screen.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ah sorry i am still learning vb abit
Anyway when the .exe file is executed from the vb program, it likes to hang abit till it is closed.
Is there a way around this
And about the progress bar thats what im after an exact copy of like XP's boot one, any ideas how to make one?
Thanks
Oli
|
|
|
|
|
What do you mean "hang a bit till it is closed"? Does it do this only when launched from VB or does it always do this? If it always does it, the exe is running some kind of final termination code. Running it from VB should make no difference...
As far as doing a progress bar that loops a period or whatever, you will have to do it on a different thread because the thread that launches the exe will be blocked until the the Wait function becomes signalled.
Exactly how you go about this just depends on your application design. You could create a new thread for the "progress" loop. But if your application already showing some kind of UI, then you should run the loop there and create the new thread to run the EXE instead.
Either way, you will have to have two threads, no way around it.
Robert
|
|
|
|
|
phraser wrote:
And about the progress bar thats what im after an exact copy of like XP's boot one, any ideas how to make one?
Lucky for you -> Building a Progress Bar that Doesn't Progress[^] on MSDN.
phraser wrote:
Anyway when the .exe file is executed from the vb program, it likes to hang abit till it is closed.
I have no idea what you mean by this and what the problem is with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The problem with the program is that when the exe is executed ( calc.exe ) the VB program freezes ( dosent respond ) till the calc.exe is closed.
This is a problem because i have a label that is ment to show as the file runs but as the program freezes waiting for this other program to close it dosent not show.
Thanks
Oli
|
|
|
|
|
phraser wrote:
when the exe is executed ( calc.exe ) the VB program freezes ( dosent respond ) till the calc.exe is closed.
That's what .WaitForExit() is supposed to do!
You never mentioned anything about updating a label. Set the label Text how you want, call Application.DoEvents() , then launch your external app, like calc. Once you hit the .WaitForExit() call, that thread is blocked from executing until the external app closes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It still effects it even if the updated label is ment to update before the process is ran?
*EDIT* It worked fine but i still have one problem i have my progress bar working fine now and i enable it before i put Application.DoEvents() yet it does not want to like progress along if u know what i mean lol just it stops till i exit the program where the thread continues.
Any command to process this type?
Thanks
Oli
|
|
|
|
|
If your progress bar is written correctly (multi-threaded), then it should update while another part of the form code is blocked.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The code i use is as follows
ProgressBar1.Visible = True
ProgressBar1.Value = 0
Timer1.Enabled = True
Application.DoEvents()
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("calc.exe")
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit()
pStart.Close()
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value >= 100 Then _
ProgressBar1.Value = 0
Return
End Sub
How would i multi-thread the process?
Thanks
Oli
|
|
|
|
|
You can't do it using a form-based timer.
Read the article that I already posted the link to. Everything is in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
*EDIT*
Never mind fixed it
Thanks
Oli
|
|
|
|
|
I am new to VB.net and have a form with a number keypad on it using buttons. I need to adjust the buttons when the user resizes the form. Can someone tell me how to do this?
|
|
|
|