Pgmer 50 Master Poster Featured Poster

Why cant you give button in form, let the user make selection and click button to show records on form 2. And use the view to filter the records. This is the second thread u opend for same issue. :) try different ways of doing things. If you keep doing the same thing result will be the same.. :)

Pgmer 50 Master Poster Featured Poster

Instead you do one thing,
First show up the login form and validate is user is already registered if not show the registration form.

Pgmer 50 Master Poster Featured Poster

Then please mark this thread as solved

Pgmer 50 Master Poster Featured Poster

For this u need to write procedure to delete row from db or SQlL statement by passing the condition to delete. And load the new set of data and bind back to grid.

Pgmer 50 Master Poster Featured Poster
Dim arrImage() As Byte
        Dim openFile As New OpenFileDialog
        If openFile.ShowDialog() = Windows.Forms.DialogResult.OK Then
            arrImage = System.IO.File.ReadAllBytes(openFile.FileName)
        Else
            Exit Sub
        End If
Pgmer 50 Master Poster Featured Poster

Happens :)

Pgmer 50 Master Poster Featured Poster
Dim myTabPage0 As New TabPage()
        myTabPage0.Text = "Event " & (TabControl1.TabPages.Count + 1)
        TabControl1.TabPages.Add(myTabPage0)
        Dim txt As New TextBox
        txt.Text = "Test"
        myTabPage0.Controls.Add(txt)

Try if this helps u

Pgmer 50 Master Poster Featured Poster

without installing framework you want to run your application on client system?

Pgmer 50 Master Poster Featured Poster

The code i posted is working fine for me in my project.
if you can send your excel file column names and Sheet name we can try out.

Pgmer 50 Master Poster Featured Poster

select Columns names from [sheet$]
Columns names are you column names in excel and Sheet$ is the name of ur sheet in excel from where you want to import. If it is one time activivty do it using Maping from SQL wizard or else write code as shown above...

Pgmer 50 Master Poster Featured Poster

Why ur doing E.formatedvalue? instead you can get the cell text using Activecell.text right?

Pgmer 50 Master Poster Featured Poster

Try your code in Cell Enter event, cell leave event and see. And if Not valid entry then dont forget to clear the cell.

Pgmer 50 Master Poster Featured Poster
Try
            Dim fBrowse As New OpenFileDialog

            With fBrowse
                .Filter = "Excel files(*.xls)|*.xls|All files (*.*)|*.*"
                .FilterIndex = 1
                .Title = "Import data from Excel file"
            End With
            If fBrowse.ShowDialog() = Windows.Forms.DialogResult.OK Then
                Dim fname As String
                fname = fBrowse.FileName
                Dim MyConnection As System.Data.OleDb.OleDbConnection
                Dim DtSet As System.Data.DataSet
                Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
                MyConnection = New System.Data.OleDb.OleDbConnection _
                ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fname & ";" & "Extended Properties=""Excel 8.0;HDR=NO;IMEX=1""")
                MyCommand = New System.Data.OleDb.OleDbDataAdapter("select Columns names from [sheet$]", MyConnection)
                
                MyCommand.TableMappings.Add("Table", "Ur table name.")
                DtSet = New System.Data.DataSet
                MyCommand.Fill(DtSet)
'If dataset is not empty Then write code here to insert values to DB.
                MyConnection.Close()
            End If
  Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try

After getting the data into data set. loop throgh ur dataset and insert the values in to DB. There myt be many techniques for this... but i know this one. you can dirctly map the Excel file to SQL using SQL wizard.

Pgmer 50 Master Poster Featured Poster

Use math.round method u can pass how many digits you want to show.
And from next time, plz mark thread as solved and create new for new Query..

Pgmer 50 Master Poster Featured Poster

Ur letting the user to enter the data in gridview cell?

Pgmer 50 Master Poster Featured Poster

At which line are u getting the error?

Pgmer 50 Master Poster Featured Poster

get those values into integers and compare.

Dim param As Integer = 122
        Dim compval As Integer = Label.Text
        If compval > param Then
            MsgBox("greater")
        Else
            MsgBox("Less")
        End If

This is just sample.. you need to make changes in ur case

Pgmer 50 Master Poster Featured Poster

Why cant you load the types into combobox? and when selected index changed and selected item is "Software" get the data for Software or u can use dataview for this and rebind the grid..

Pgmer 50 Master Poster Featured Poster

Ruchi224 please mark the thread as solved if its is solved.
It helps the forum to maintain clean.. dont just escape after getting the soluution. Actulally i should post this.. but i saw two of ur post are solved but u forgot to mark as solved.

Pgmer 50 Master Poster Featured Poster

Go to the properties of lable.. under Image select the image u want to assign.
Make the text emty. And set autosize=false and set the size you want.

Pgmer 50 Master Poster Featured Poster

Have you checked the database for record after insert?

Pgmer 50 Master Poster Featured Poster

At what line of code ur getting the error?

Imports System.Data
Imports System.Data.OleDb
Imports System.EventArgs
Imports System.Data.OleDb.OleDbCommand
Imports System.Data.OleDb.OleDbConnection

Public Class ContactInfo_supp
Inherits System.Windows.Forms.Form

Dim Message As String
Dim cn As OleDbConnection
Dim cmd As OleDbCommand



Private Sub button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button3.Click

Try
'MsgBox("Open")
cn = New OleDbConnection("Provider=microsoft.jet.oledb.4.0;Data Source=E:\Project-Hemtech\HemDatabase1.mdb;")
cn.Open()
cmd = New OleDbCommand("insert into contactinfo(usertype,compname,compadd,compcity,comppin,compphcode,compph,compfaxcode,compfax,compmail,compsite,compregoff,compfact,products,interest,region,place,contper1,comprole1,compemail1,contnum1,ext1,mobnum1,contper2,comprole2,compemail2,contnum2,ext2,mobnum2,contper3,comprole3,compemail3,contnum3,ext3,mobnum3,weeklyoff,vat,cst,pan,ecc,commissionerate,range,division,servicetax,bankname,bankbranch,accnum,rtgs,instrname,modelnum,installdate,amc,callibration,period,expdate) values ('Supplier','" & textBox1.Text & "','" & textBox2.Text & "','" & textBox39.Text & "','" & textBox41.Text & "','" & textBox45.Text & "','" & textBox3.Text & "','" & textBox4.Text & "','" & textBox46.Text & "','" & textBox5.Text & "','" & textBox6.Text & "','" & textBox7.Text & "','" & textBox8.Text & "','" & textBox42.Text & "','" & textBox43.Text & "','" & ComboBox1.SelectedItem.ToString() & "','" & textBox44.Text & "','" & textBox9.Text & "','" & textBox10.Text & "','" & textBox47.Text & "','" & textBox11.Text & "','" & textBox12.Text & "','" & textBox13.Text & "','" & textBox18.Text & "','" & textBox17.Text & "','" & textBox48.Text & "','" & textBox16.Text & "','" & textBox15.Text & "','" & textBox14.Text & "','" & textBox23.Text & "','" & textBox22.Text & "','" & textBox49.Text & "','" & textBox21.Text & "','" & textBox20.Text & "','" & textBox19.Text & "','" & textBox50.Text & "','" & textBox25.Text & "','" & textBox26.Text & "','" & textBox27.Text & "','" & textBox28.Text & "','" & textBox29.Text & "','" & textBox30.Text & "','" & textBox31.Text & "','" & textBox32.Text & "','" & textBox33.Text & "','" & textBox34.Text & "','" & textBox35.Text & "','" & …
Pgmer 50 Master Poster Featured Poster
Pgmer 50 Master Poster Featured Poster

Then plz could you mark the thread as solved?

Pgmer 50 Master Poster Featured Poster

The above code by Unhnd_Exception works fine...

Pgmer 50 Master Poster Featured Poster

What error ur getting?

Pgmer 50 Master Poster Featured Poster

Are you looking for specific textbox to get the value of num , num 2,num 3?

Pgmer 50 Master Poster Featured Poster
Dim txtMo As TextBox
        For Each ctrl As Control In Me.Controls
            If (ctrl.Name.StartsWith("txtDimVal")) AndAlso (TypeOf ctrl Is TextBox) Then
                txtMo = DirectCast(ctrl, TextBox)
                MsgBox(txtMo.Text)
            End If
        Next ctrl

you want to compare the text?

Pgmer 50 Master Poster Featured Poster

What is the issue or problem with above code? i mean whats not hapening?

EDIT: have you declared txtmemo as textbox?
and what is MsgBox(txtMo)? txtmemo.name? txtmemo.text?

Pgmer 50 Master Poster Featured Poster

Please check ur join condition and pass more info on Query

Pgmer 50 Master Poster Featured Poster

Why cant u set the MAXLength propery of textbox to 10?

Pgmer 50 Master Poster Featured Poster

In get values of array you need to see if any extra white space which doesnt have any value.

Pgmer 50 Master Poster Featured Poster

Can you paste the code what your getting into strsql before running cmd.ExecuteNonQuery()

Pgmer 50 Master Poster Featured Poster

Before executing the Query i.e. cmd.ExecuteNonQuery()
Get the commandstring i.e:strsql and paste it on ur SQL server and see whether the statement is formated properly or not.

Pgmer 50 Master Poster Featured Poster

When u click on delete button
bind the second grid also with same dataset as firstform

If dr.HasRows Then
                While dr.Read
                  
                    DGVStudRecord.Rows.Add(dr(0), dr(1), dr(2), dr(3), dr(4), dr(5))
                    form2.grid.rows.add(dr(0), dr(1), dr(2), dr(3), dr(4), dr(5))

                End While
            End If
Pgmer 50 Master Poster Featured Poster

Try using the for loop.

for i as integer=0 to DataGridView1.rows.count-1
     ' Add your code which adds records to list  
   Next

Are you using listbox?

Pgmer 50 Master Poster Featured Poster

Get the datagridview records into table or dataset and loopthough the recods and add to list view in loop

Pgmer 50 Master Poster Featured Poster

Addrange method expects the array to be passed. Get all ur items in Array wich u want to add to combo. And pass the array in AddRange method...

Dim days() As String = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
        ComboBox1.Items.AddRange(days)
Pgmer 50 Master Poster Featured Poster

IF it has solved your problem then plz mark the thread as solved.

Pgmer 50 Master Poster Featured Poster
Dim pinnum As String = "1234"
        Dim pinentered As String = TextBox1.Text
        If pinentered = StrReverse(pinnum) Then
            MessageBox.Show("Please eneter the pin properly")
        ElseIf pinentered = pinnum Then
            MessageBox.Show("Correct pin")
        End If

You need to get the pin u want to compare with into varioable pinnum here i took for example.

Pgmer 50 Master Poster Featured Poster

Then plz mark the thread as solveld :)

Pgmer 50 Master Poster Featured Poster

Then try to set the datasource as nothing.
Make the datasoruce of Listbox=nothing

Pgmer 50 Master Poster Featured Poster

Take the values and compare not text.

Pgmer 50 Master Poster Featured Poster

Do you use any data base for your project? If yes then why cant you do it at the backend?

Pgmer 50 Master Poster Featured Poster

Whats not working? Whats your complete code? from where you want to access this function? give details...

Pgmer 50 Master Poster Featured Poster

i told how to create function in VB.net in my previous post. whats ur exact problem?

Pgmer 50 Master Poster Featured Poster

Or you can do something like this

For Each contr As Control In Me.Controls
                If TypeOf contr Is TextBox Then
                    contr.BackColor = Control.DefaultBackColor
                End If
            Next

I have done for textbox. You can use for lable or any other controls who's property u want to set to default.

Pgmer 50 Master Poster Featured Poster

Write one more method to change the colr or proprties of linklable. i dont think there is way to set it back automatically.

Pgmer 50 Master Poster Featured Poster

You want to use this function in all the forms? or in just one form?
If all Create function in Module with Public member
like

Public Function auto_generate_id() as Integer
' After your code retrnuj the value
Return J

End function

Pgmer 50 Master Poster Featured Poster

What you mean by reseting form and its controls? Pass more info on what u need exactly.