Please Mark the thread as reolved
Naveed_786 25 Posting Whiz in Training
Naveed_786 25 Posting Whiz in Training
Naveed_786 25 Posting Whiz in Training
Please Mark the thread as reolved
I think You should use Textbox name instead column name in your insert statement in values section you are entering your column name you should use textbox name follow this example
sqlInsert = "INSERT INTO tracker(TrioleNo,TrioleOpenDate,Description,Qty,Price) VALUES ('" & Me.Textbox1.Text & "','" & Me.Textbox2.Text & "','" & Me.Textbox3.Text & "','" & Me.Textbox4.Text & "','" & Me.Textbox5.Text & "')"
I hope this would help you.
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
Try
'MsgBox("Open")
cn = New OleDbConnection("Provider=microsoft.jet.oledb.4.0;Data Source=E:\Project-Hemtech\HemDatabase1.mdb;")
cn.Open()
com = New OleDbCommand("select partname,partdesc,partnum,partqty from partno WHERE type = '" & combobox1.Text & "'", cn)
cmd.ExecuteNonQuery()
MsgBox("Your Account Created Successfully ")
Me.PartnoTableAdapter.Fill(Me.HemDatabase1DataSet1.partno)
Catch myException As Exception
MsgBox("No Record Inserted" + myException.ToString())
Finally
'MsgBox("Closing Connection")
cn.Close()
End Try
End Sub
Just replace this code with the previous code
Ok then just change this line you would have the result.
com = New OleDbCommand("select partname,partdesc,partnum,partqty from partno WHERE type = '" & combobox1.Text & "'", cn)
First of all you must create a textbox on your form then enter type in text box and change this line of code
com = New OleDbCommand("select partname,partdesc,partnum,partqty from partno WHERE type = '" & textbox1.Text & "'", cn)
Hope this would help you.
Are you sure you are using vb.net as i know there is only one name by default which is datagridview1 if you have changed the name of datagridview1 to datagrid1 then just replace datagridview1 with datagrid1
First of all you should mention the language you are using is it VB.NET
if yes then here is the code
Private Sub DataGridView1_UserAddedRow(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) Handles DataGridView1.UserAddedRow
If DataGridView1.Rows(e.Row.Index).IsNewRow Then
If e.Row.Index = 1 Then
DataGridView1.Rows(e.Row.Index - 1).Cells(0).Value = e.Row.Index
Else
DataGridView1.Rows(e.Row.Index - 1).Cells(0).Value = DataGridView1.Rows(e.Row.Index - 2).Cells(0).Value + 1
End If
End If
End Sub
Please mark the thread as solved if your problem has been resolved
Hi
I want to display content of text boxes in its tool tip how it can be done.
Thanks
Just Get the properties of textbox then find the property tooltip text then type some text with you want to display at run time
Please download and view the attachment below
Please mark the thread as solved if it helps you.
You must post this question in right section.
Waht do you mean i didn't understand do you want to generate autonumber on your form and then want to store in database??????????
You can use setup factory to create installer for your application.
Dear,
Here is your problem just correct it i hope it would help you
Dim sqlQRY As String = "SELECT * FROM Purchse WHERE(" + Me.ComboBox1.SelectedItem + ")LIKE('%" + Me.TextBox1.Text + "%');"
Just write this line and follow my instruction
1.You have one combobox its name would be combobox1
2.Just left click on combobox then goto its properties
3.Get item property here you should add Code column or any other column which you want to search.
4.When you select a column from combobox and enter criteria in textbox then click om search button it would populate record against your query hope this would help and would resolve your problem let me know if you have any problem.
Ok let me ask some questions
Dim sqlQRY As String = "SELECT * FROM YourTable Name WHERE(" + Me.ComboBox1.SelectedItem + ")LIKE('%" + Me.TextBox1.Text + "%');"
1. Just tell me what is your table name?
2. Did you made changes in the code which i have provide you?
3. It sounds me like you didn't modify code just copy and paste.
4. ok just simply copy whole the code and paste it here i will check whats the problem.
firs of all you should add these libraries in your form
Imports System
Imports System.Data
Imports System.Data.OleDb
Then copy and pase this code hope this would help you.
If ComboBox1.Text = "" Then
MessageBox.Show("Please Select a Search Field From Combobox!", " You Software name ", MessageBoxButtons.OK, MessageBoxIcon.Information)
ElseIf TextBox5.Text = "" Then
MessageBox.Show("Please Enter Search Criteria To Search Record!", "You Software name", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Try
'Set up connection string
Dim cnString As String
cnString = ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Application.StartupPath & "\DB.mdb;")
'Create connection
Dim conn As OleDbConnection = New OleDbConnection(cnString)
'Try
' Open connection
conn.Open()
Dim sqlQRY As String = "SELECT * FROM YourTable Name WHERE(" + Me.ComboBox1.SelectedItem + ")LIKE('%" + Me.TextBox1.Text + "%');"
'create data adapter
Dim da As OleDbDataAdapter = New OleDbDataAdapter(sqlQRY, conn)
'create dataset
Dim ds As DataSet = New DataSet
'fill dataset
da.Fill(ds, "YourTableName")
'get data table
Dim dt As DataTable = ds.Tables("YourTable Name")
'display data
Dim row As DataRow
For Each row In dt.Rows
TextBox1.Text = row("C1Name")
TextBox2.Text = row("C2Name")
TextBox3.Text = row("C3Name")
TextBox4.Text = row("C5Name")
Next row
If ds.Tables("YourTableName").Rows.Count = 0 Then
MessageBox.Show("Sorry No Record Found Please Try Again!", " You Software name ", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
' Close connection
conn.Close()
Catch ex As OleDbException
MessageBox.Show("Customer Not found" + ex.Message)
End Try
End If
I hope this would help pleae mark thrad solved if it help.
you must add this code on form load event of splach screen form
me.close()
form1.show()
Ok you can
1. add datareport by opning the project you have made
2. Right click on Your project name for example project1 then click on add it will populate another list then choose datareport from there now the datareport would included in your project.
If you have any other problem then let me.