Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: asp.net

  1. #11

    Default Re: asp.net


    Quote Originally Posted by skeptic_rob View Post
    OleDbCommand cmd = new OleDbCommand("INSERT INTO Reservation values (" +' '+"'" + this.TextBox1.Text + "','" + this.TextBox7.Text + "','" + this.TextBox3.Text + "','" + this.TextBox4.Text + "','" + this.TextBox5.Text + "','" + this.TextBox6.Text + "')", conn);

    mo auto increment taha cya ba sa textbox ....no idea at all

    in ani ako g code sa button

    int i = 0

    i = i + 1;

    text1.text = "" + i; mao ra g hapon dli mo ganha i need ur assistance mga expert
    Never tested on this but try something like this:

    C#:

    protected void Button1_Click(object sender, EventArgs e){
    int sum = int.Parse(TextBox1.Text.Trim()) + 1;
    TextBox1.Text = sum.ToString();
    }

    VB.NET:

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim sum As Integer = Integer.Parse(TextBox1.Text.Trim()) + 1
    TextBox1.Text = sum.ToString()
    End Sub

    This will increment the value of your TextBox to 1 everytime you clicked on the Button.

    Important note:

    Also, I will not recommend you to append the values directly into your SQL statements especially when doing inserts because that would leads you to SQL Injection , use Parameterized Query instead for security..

  2. #12

    Default Re: asp.net

    puyde ra identity column nalang sa sql. para dali

  3.    Advertisement

Page 2 of 2 FirstFirst 12

Similar Threads

 
  1. ASP.net webhosting?
    By kempee in forum Websites & Multimedia
    Replies: 1
    Last Post: 04-07-2009, 01:09 PM
  2. PHP 5.0 vs. ASP.NET 2.0
    By morphian in forum Programming
    Replies: 11
    Last Post: 04-12-2007, 03:44 PM
  3. Replies: 4
    Last Post: 11-04-2006, 03:59 PM
  4. vb.net/asp.net
    By Drksrvnt in forum Programming
    Replies: 0
    Last Post: 08-30-2006, 01:36 PM
  5. ASP.net tutorial
    By nullvalue in forum Websites & Multimedia
    Replies: 0
    Last Post: 03-28-2006, 04:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top