2,383 Posted Topics
Re: Try This : Public Conn As New ADODB.Connection Private Sub Access_Connector() Set Conn = New ADODB.Connection Conn.Provider = "microsoft.jet.oledb.4.0" Conn.CursorLocation = adUseClient Conn.Open App.Path & "\project.mdb" End Sub Private Sub GetData() Set rs = New ADODB.Recordset rs.Open "SELECT * from goods ", Conn, adOpenDynamic, adLockBatchOptimistic While Not rs.EOF List1.AddItem rs.Fields("tabid") … | |
Re: Hi gino_j... This thread too old and you post in wrong section. this for vb 6 not for vb.net :) | |
Re: u just to handle keychar. try this following code : [CODE=vb] Private Sub text1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles text1.KeyPress If (Microsoft.VisualBasic.Asc(e.KeyChar) < 65) _ Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 90) _ And (Microsoft.VisualBasic.Asc(e.KeyChar) < 97) _ Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 122) Then 'space allowed If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then … | |
This code to save, Edit and delete data in VB.Net using SQLServer as backend. this code is continuance from my previous post "Show Data in DataGrid with VB.Net 2003 and SQLServer 2000". so i didn't write code how to connect SQLServer 2000 with VB.Net 2003 cause this already in there. … | |
Re: Please more detail. What you mean about TEXT? it's Textbox? | |
Re: First, your code is not running. You missing 's' in every ListItems and SubItems statements. Second, As default you can't select entire rows. It's because version 5.0 (SP2) does not support it. but if you use version 6.0, your listview will able to do that with set FullRowSelect = true. … | |
Re: [Read this thread](http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/436489/transfer-data-from-one-form-to-another) You can use andre concept. Add module, make public variable to accomodate your inputs in form 1 to form 4. set every input to those variable in each form. Ex : 'in module Public a,b,c,d as Integer 'in form1 a = Val(Text1.Text) 'in form2 b = Val(Text2.Text) … | |
Re: i think wayne already answered this thread. :D | |
Re: You can use Timer control. Set Enabled=True on Timer properties Set Interval as you needed. Interval in milliseconds. (e.g 1000 = 1 Second) Then put your checking code in Timer event : [CODE]Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ' Your Code End Sub[/CODE] | |
Re: What you mean about disappeared? you mean remove selected item from combobox? Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged ComboBox1.Items.Remove(ComboBox1.SelectedItem) End Sub | |
Re: 1 Textbox, 1 Button. Result showing in form caption : Private Sub Command1_Click() Dim TextLines As Variant TextLines = Split(Text1, vbNewLine) Form1.Caption = "Sockz-" & (UBound(TextLines) + 1) End Sub | |
Re: missing single quote : [CODE]Dim cmd2 As New OleDb.OleDbCommand("DELETE FROM tblPNGATSAExecutive WHERE ExecutiveID = '" & lvData.Items(ItemNo).SubItems(0).Text & "'", conn)[/CODE] | |
Re: connect with database?what it is? if used database binding in datagrid try with LIKE operator to searching more thorough. | |
Re: actually you didn't give much information for your problem.what database that you've using? see this link : [URL="http://www.codeproject.com/KB/database/relationaladonet.aspx"]http://www.codeproject.com/KB/database/relationaladonet.aspx[/URL] | |
Re: Using Package and deployment on your visual studio tools. | |
Re: hi zuniza, hmm interesting project, you must work hard to make all. i agree with Walkere to this recommended [QUOTE]In particular I'd recommend one of two: * phpBB * Simple Machines Forum[/QUOTE] | |
Re: transparency Window and all controls? | |
Re: vbDatabaseCompare uses the current setting of the database's string comparison operator. Normally this will use the computer's language setting to handle (e.g.) accented characters, and will be case insensitive. The alternative vbBinaryCompare will compare the exact ASCII representation of the character. For example: `Instr(1,"XYZabcxZ","x",vbDatabaseCompare)` 1 `Instr(1,"XYZabcxZ","x",vbBinaryCompare)` 7 The first example … | |
Re: Use UCase() or LCase () function. all string will be converted to upper or lower string If UCase(Text1.Text) = UCase("red") And Label4.BackColor = vbRed Then score = score + 1 Label6.Caption = score End If or if you just want to make uppercase the first string mystring = Text1.Text If … | |
Re: I believe that problem is Picture_Name. You put Picture_Name in your insert statement but it never been declared in CmdSave. Why you don't use lblPicture_Name? it hold picture name too. Conn.Execute "INSERT INTO Ministers_AccountTB(User_Name,Password,Prefix,Privilege,Passport) VALUES ('" & txtUser_Name.Text & "','" & txtRetype_Password.Text & "','" & cmbPrefix.Text & "','" & cmbPrivilege.Text … | |
| |
Re: Post your code. How far you doing this and we try to help you. | |
Re: make a module to connect vb.net with sql server. add this code to module : [CODE]Imports System.Data Imports System.Data.SqlClient Module Connect Public conn As SqlConnection Public Function GetConnect() conn = New SqlConnection("Server = YourServerName;" & "initial Catalog = yourDatabaseName;" & " Trusted_Connection=yes") Return conn End Function End Module [/CODE] you … | |
Re: Your open recordset parameter not completed. Sub Open([Source], [ActiveConnection], [CursorType As CursorTypeEnum = adOpenUnspecified], [LockType As LockTypeEnum = adLockUnspecified], [Options As Long = -1]) It should looks like this : rspassword.Open "Select * from table1", Con, adOpenDynamic, adLockBatchOptimistic | |
Re: All projects use .Net 2.0, 3.0, 3.5, or 4.0 You can change the version in Project Properties -> Compile -> Advanced Compile Option | |
Re: Put this on your form code : Protected Overrides Function ProcessTabKey(ByVal forward As Boolean) As Boolean MyBase.ProcessTabKey(forward) MsgBox("Tab key") ' Change this with your retrieving code or function name End Function | |
Re: Add in your declaration : [code]Const MAX_PATH As Integer = 260[/code] | |
Re: I don't get what you mean. You want add value from textbox to datagrid? | |
Re: hmm...you want to connect with sqlserver or oracle??? | |
Re: [code=mssql]DELETE FROM emp e WHERE rowid>(SELECT MIN(ROWID) FROM emp WHERE e.empno=empno)[/code] | |
Re: see this thread... [URL="http://www.daniweb.com/forums/thread89479.html"]http://www.daniweb.com/forums/thread89479.html[/URL] | |
Re: this a simple way to play some media files, but maybe cannot play mp3.file you can use mmControl 6.0 on component : Private Sub Form_Load() [CODE]MMControl1.Notify = False MMControl1.Wait = True MMControl1.Shareable = False[/CODE] 'to play .avi file [CODE]MMControl1.FileName = "c:\test.avi" MMControl1.Command = "Open"[/CODE] ' to play .wav file [CODE]MMControl1.FileName … | |
Re: what u mean about 6 data here? 6 rows added when you click add or 6 data (6 fields) in on row? [QUOTE]sql = "insert into Pengurus(name, staff no.,items, quantity, date )" & "values ('" & txtQtt.Text & "', '" & txtDate.Text & "') "[/QUOTE] in your sql statment you … | |
Re: try this following code : [CODE=vb]Public Sub ClearTextBox(ByVal root As Control) For Each ctrl As Control In root.Controls ClearTextBox(ctrl) If TypeOf ctrl Is TextBox Then CType(ctrl, TextBox).Text = String.Empty End If Next ctrl End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ClearTextBox(Me) End Sub[/code] … | |
Re: other suggestion use timer. question for u : why teme64 suggestion with sleep() function doesn't work for u? cause i think is better to use sleep than timer control. | |
Re: [QUOTE=vanesh;1768092]How to connect datagrid from database using adodb connection. so that the records in the database will display in the datagrid. I have category here that i want to display to datagrid: ID, LName, FName, GLevel. I need a code for that. THANK YOU![/QUOTE] Connect to what database? | |
Re: [code=vb] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Item As String For Each Item In ComboBox1.Items With ComboBox2.Items .Add(Item) End With Next End Sub[/code] | |
Re: Don't put Remaining items on purchasing table. Put it on their own table. (e.g Reebok, Adidas,..) So you just update Stock Field in related table (adidas or reebok, etc) every transactions recorded in table purchase. | |
Re: hi isaya, how far you doing this? post your code and we will trying to help you, | |
Re: there are many ways : 1. put the exe file on startup folder (manually) 2. Get the Startup folder and copied your exe file to startup folder. 3. Use registry to run your program when windows start. | |
Re: [QUOTE=jennylynB;1758311]hi.....im jennylyn,i would like to ask you guys if what would be a code for SEARCH in database....like if we would find the name or gender????pls post a code guys....need it in our activity!!!!!!thanks..............[/QUOTE] Post your own thread [URL="http://www.daniweb.com/forums/newthread.php?do=newthread&f=4"]here[/URL]. Also post the code you working on. | |
Re: what you mean about combine? | |
Re: See if this helps : [CODE]Private Sub Recycle2(ByVal FQFileOrFolder As String) 'Late bound. Dim Delim As Integer Dim FItem As Object Const ssfBITBUCKET = 10 Delim = InStrRev(FQFileOrFolder, "\") With CreateObject("Shell.Application") For Each FItem In .NameSpace(Left$(FQFileOrFolder, Delim - 1)).Items If Not FItem.IsLink Then If UCase$(FItem.Name) = UCase$(Mid$(FQFileOrFolder, Delim + 1)) … | |
Re: You can capture the form resizing event then set the form into normal size. Private Sub Form_Resize() If (Me.WindowState <> vbMinimized) Then Me.Width = 4800 Me.Height = 3600 End If End Sub And set max button to false. | |
Re: Add icon to imagelist. use icon picture (.ico) and change the "**view**" to "**0-lvwIcon**" on listview properties assign icon image from imagelist to listview. | |
Re: i used this to load from sqlserver 2000 [CODE]Private Sub ReadData() Dim i As Integer Dim cmdUser As New SqlCommand Dim daUser As New SqlDataAdapter Dim dsUser As New DataSet Dim dtUser As New DataTable Dim conn As SqlConnection conn = GetConnect() Try cmdUser = conn.CreateCommand cmdUser.CommandText = "SELECT * … |
The End.