Hi, I think u need to use sql command to done it.. Example: public sub OK_Click (byval sender as object, ByVal e As System.EventArgs)handles OK.click Dim cmd As New Data.OleDb.OleDbCommand cmd.Connection = mssql 'Sql command Save.... example: cmd.CommandText = "INSERT INTO [Folder] (FolderID, FolderName) " cmd.CommandText &= "VALUES ('" & me.txtFolderID.text.trim & "','" & me.txtFolderName.text.trim & "', "
Execute SQL Try cmd.Connection.Open() cmd.ExecuteNonQuery() Catch ex As OleDb.OleDbException msgbox(ex) finally connection.close() end try
i hope it can be help :)
ghost181
Posts
-
Adding row to database question -
hide show clock taskbar properties on run time?Hi, May i know how to uncheck the show clock in taskbar properties when my system on loading.
-
Lost Focus on Mdi Parent Button?Hi, My Application cannot focus back to the mdi parent button when i close the mdi child form. [More Info] My Application have 4 flowLayoutpanel Each FLP have it own Button Center of my Application have a Backgroundworker to load my form. [Problem] Now the problem come out...when i close the backgroundworker form, i cant focus back to the FLP button.
Private Sub frmMSBin_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If Not Me.MdiParent Is Nothing And Not Me.Modal Then CType(Me.MdiParent, frmMainMenu).btnBin.focus End If End Sub
Here is one of my form closing. Anyone pls help.. -
Open CalculatorHi, Thanks :laugh:
-
Open CalculatorHi, I have a window form call Form1. I want to create a button that can open calculator in form1. after i open the calculator, it will disable the form1. when i close th calculator, it will enabled form1 back. My problem is i cant disable the form1...anyone know the solution pls help..
process.start("calc.exe")
i use this code to open the calculator. -
Cant Disable Right Window Logo Keystill cannot disable the right window logo key.
If e.KeyCode=Keys.RWin Then
code here also just allow me to disable the left window logo key. -
Cant Disable Right Window Logo KeyHi, I cant disable the right window logo key in my application?Can anyone help to find out the solution. Here is my code
Private Sub Textbox1_KeyDown(Byval Sender as Object,Byval e as System.windows.Forms.KeyEventArgs) Handles Textbox1.KeyDown if e.keyCode=Keys.Rwin Then e.Handled=true End If End Sub
Pls help me....:( -
Cant Disable Right Window Logo KeyHi, i cant disable the right window logo keys when i run my application. i use the following code to disable the window logo keys, but it just can disable left window logo key. private sub Textbox1_KeyDown(Byval sender as object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Textbox1.KeyDown if e.keycode=keys.LWin and e.keycode=Keys.RWin then e.handled=true end if end sub Pls Help me...:(
-
Resource fileHi, you can try the code below using System; using System.Runtime.InteropServices; using System.Resources; using System.IO; namespace Win32 { public class Winmm { public const UInt32 SND_ASYNC = 1; public const UInt32 SND_MEMORY = 4; // these 2 overloads we dont need ... // [DllImport("Winmm.dll")] // public static extern bool PlaySound(IntPtr rsc, IntPtr hMod, UInt32 dwFlags); // [DllImport("Winmm.dll")] // public static extern bool PlaySound(string Sound, IntPtr hMod, UInt32 dwFlags); // this is the overload we want to play embedded resource... [DllImport("Winmm.dll")] public static extern bool PlaySound(byte[] data, IntPtr hMod, UInt32 dwFlags); public Winmm() { } public static void PlayWavResource(string wav) { // get the namespace string strNameSpace= System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString(); // get the resource into a stream Stream str = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( strNameSpace +"."+ wav ); if ( str == null ) return; // bring stream into a byte array byte[] bStr = new Byte[str.Length]; str.Read(bStr, 0, (int)str.Length); // play the resource PlaySound(bStr, IntPtr.Zero, SND_ASYNC | SND_MEMORY); } } } ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::; To use the class, you can make the call as follows: private void button2_Click(object sender, System.EventArgs e) { Win32.Winmm.PlayWavResource("chimes.wav"); }
-
Disable Alt+Tab and windows Keys?Hi, I find the solution already. thx :-D
-
Disable Alt+Tab and windows Keys?Hi, Sorry forget to tell you what version i am using. I am using vb.net 2005 to develop a windows form.
-
Disable Alt+Tab and windows Keys?Hi, may i know how to disable alt+tab and windows key for my application? ghost
-
Windows Question? -
ADO.NET QuestionThanks Colin Angus Mackay, i solve the problem already.:)
-
ADO.NET QuestionMay i know what is the problem in my code below? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try If TextBox1.Text <> "" Then Dslogin1.Clear() OleDbDataAdapter1.SelectCommand.CommandText = _ "SELECT * FROM Login WHERE username = " & TextBox1.Text & "" OleDbDataAdapter1.Fill(Dslogin1, "Login") DataGrid1.SetDataBinding(Dslogin1,"Login") End If Catch e1 As Exception MessageBox.Show(e1.ToString) End Try End Sub i cant search the username from the textbox1.