zeeshanef's Profile User Rating: -----

Reputation: 17 Tradesman
Group:
Active Members
Active Posts:
71 (0.08 per day)
Joined:
14-April 12
Profile Views:
1,356
Last Active:
User is offline Jun 06 2014 08:58 AM
Currently:
Offline

Previous Fields

Country:
PK
OS Preference:
Who Cares
Favorite Browser:
Opera
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   zeeshanef has not set their status

Posts I've Made

  1. In Topic: overwrite text in masked textbox without selecting or deleting content

    Posted 6 Jun 2014

    Simply:
    maskedTextBox1.InsertKeyMode = InsertKeyMode.Overwrite;
    
  2. In Topic: After deploy application not working well

    Posted 28 Aug 2013

    Can you show your web.config file.
  3. In Topic: reload problem

    Posted 28 Aug 2013

    From where you are loading data? may be after postback view state is cleared.
  4. In Topic: Adding New Record To Database And View in Datagrid

    Posted 15 Feb 2013

    your first method seems good, but you need to Open connection before execute query!
    try this:

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
    Dim sql As String
    Dim cmd As SqlCommand
    Dim cons As String
    Dim con As SqlConnection
    
            cons = "Data Source=.\SQLSERVER2008;AttachDbFilename=|DataDirectory|\ProductsDatabase.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
            con = New SqlConnection(cons)
    
            sql = "Insert into Products(ProductCode, ItemName, Size, SRP, WholeSalePrice, OriginalPrice, Availability, Color, Description, Supplier)" & _
            "values (@ProductCode, @ItemName, @Size, @SRP, @WholeSalePrice, @OriginalPrice, @Availability, @Color, @Description, @Supplier)"
            cmd = New SqlCommand(sql, con)
    
    
                cmd.Parameters.Add("@ProductCode", SqlDbType.NChar, 10).Value = Me.ProductCodeTextBox.Text.Trim
                cmd.Parameters.Add("@ItemName", SqlDbType.NVarChar, 50).Value = Me.ItemNameTextBox.Text.Trim
                cmd.Parameters.Add("@Size", SqlDbType.NChar, 10).Value = Me.SizeTextBox.Text.Trim
                cmd.Parameters.Add("@SRP", SqlDbType.NChar, 10).Value = Me.SRPTextBox.Text.Trim
                cmd.Parameters.Add("@WholeSalePrice", SqlDbType.NChar, 10).Value = Me.WholeSalePriceTextBox.Text.Trim
                cmd.Parameters.Add("@OriginalPrice", SqlDbType.NChar, 10).Value = Me.OriginalPriceTextBox.Text.Trim
                cmd.Parameters.Add("@Availability", SqlDbType.Bit).Value = avail
                cmd.Parameters.Add("@Color", SqlDbType.NVarChar, 50).Value = Me.ColorTextBox.Text.Trim
                cmd.Parameters.Add("@Description", SqlDbType.NVarChar).Value = Me.DescriptionTextBox.Text.Trim
                cmd.Parameters.Add("@Supplier", SqlDbType.NVarChar).Value = Me.SupplierTextBox.Text.Trim
    		Try
    			con.Open()
                cmd.ExecuteNonQuery()
                formMain.ProductsTableAdapter.Update(formMain.ProductsDatabaseDataSet.Products)
                formMain.ProductsDatabaseDataSet.AcceptChanges()
                MsgBox("New Record Saved! ")
            Catch ex As Exception
                MsgBox(ex.ToString)
    		Finally
    			If con.State = ConnectionState.Open Then con.Close()
            End Try            
    End Sub
    
  5. In Topic: Help with VB.Net and MySQL: Next/Previous Record

    Posted 10 Dec 2012

    1.
    If your are using Visual Studio 2010 or greater, you can implement automatic property like:
    Public Property CompanyID As Integer
    


    else, you need to implement property like this:

    private _companyID as Integer = 0
    Property CompanyID As Integer 
        Get 
            Return _companyID
        End Get 
        Set(ByVal value As Integer)
            _companyID = value
        End Set 
    End Property
    


    See this Link:
    http://msdn.microsof...y/dd293589.aspx

    2.
    In your next button you can do something like this:
    TextBox1.Text = clientsList(n++).CompanyID
    


    And you will also check, if Index is Out of Bound.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

zeeshanef has no profile comments yet. Why not say hello?