Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3609740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:39:57+00:00 2026-05-18T21:39:57+00:00

Here is the structure of my database: i have textbox1 and textbox2 and 8

  • 0

Here is the structure of my database:

alt text

i have textbox1 and textbox2 and 8 checkboxes in my ASP.NET (VB.NET) webform.

i want to retrieve the seats on the particular dates means if i enter 11/12/2010 in textbox1 then in textbox2 the output would be from seat_select column, let say (1,2,3) where date would be 11/12/2010

If i enter 13/12/2010 in textbox1 then in textbox2 the output would be 1,2

How to do this in VB.NET?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:39:58+00:00Added an answer on May 18, 2026 at 9:39 pm

    Markup:

    <asp:TextBox runat="server" ID="txtDate" />
    <asp:Button runat="server" ID="cmdGet" Text="Get" OnClick="cmdGet_Click" />
    <asp:TextBox runat="server" ID="txtSeat" />
    

    Code-behind (C#) – formatting on presentation layer:

    protected void cmdGet_Click (object sernder, EventArgs e)
    {
        DateTime d;
        if (!DateTime.TryParseExact(txtDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out d))
            throw new InvalidOperationException("Input was in incorrect format");
    
        using (SqlConnection connection = new SqlConnection(connectionString))
        using (SqlCommand command = connection.CreateCommand())
        {
            command.CommandText = "SELECT seat_select FROM table_seats WHERE date <= @date";
            command.Parameters.AddWithValue("@date", d);
    
            connection.Open();
            using (SqlDataAdapter adapter = new SqlDataAdapter(command))
            using (DataTable table = new DataTable())
            {
                adapter.Fill(table);
                txtSeat.Text = String.Join(", ", table.AsEnumerable().Select(r => r.Field<int>("seat_select")));
            }
        }
    }
    

    Don’t forget to add the reference to System.Data.DataSetExtensions.dll, System.Core.dll.


    Code-behind (C#) – formatting on data layer:

    protected void cmdGet_Click (object sernder, EventArgs e)
    {
        DateTime d;
        if (!DateTime.TryParseExact(txtDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out d))
            throw new InvalidOperationException("Input was in incorrect format");
    
        using (SqlConnection connection = new SqlConnection(connectionString))
        using (SqlCommand command = connection.CreateCommand())
        {
            command.CommandText = "DECLARE @seats NVARCHAR(MAX); SELECT @seats = COALESCE(@seats + ', ', '') + seat_select FROM table_seats WHERE date <= @date";
            command.Parameters.AddWithValue("@date", d);
    
            connection.Open();
            txtSeat.Text = (string)command.ExecuteScalar();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to ASP.NET / .net, i have designed the screens and database
I have a problem of structure for my database. I want to know why
Here is my database structure. Relation many to many. I want to make a
For example I have a file name call A.java. Here its structure: public class
I have a document structure {'text': 'here is text', 'count' : 13, 'somefield': value}
I have a complex form in Ruby on Rails 2.3.5, here's the structure for
I'm trying to design database structure for personal finance application. Basically I'll have Transactions
I have a database table structure as follow: datatype data mytable now datatype has
Could someone give me an idea how to create this database structure. Here is
I have two tables in my database which have a one-to-one relationship. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.