0% found this document useful (0 votes)
20 views

PRACTICAL NO 6A) Multiline Textbox For Query Processing.

Uploaded by

rashminisargandh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

PRACTICAL NO 6A) Multiline Textbox For Query Processing.

Uploaded by

rashminisargandh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

6A) AIM : Multiline Textbox for Query Processing.

WebForm.aspx.cs

using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2 {
public partial class WebForm2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=.;
Initial Catalog=college;Integrated Security=True"); conn.Open();
SqlCommand cmd = new SqlCommand(TextBox1.Text, conn); SqlDataReader dr =
cmd.ExecuteReader(); ListBox1.Items.Clear(); while (dr.Read())
{
for (int i = 0; i <= dr.FieldCount - 1; i++)
{
ListBox1.Items.Add(dr[i].ToString());
}
}
}
}
}

You might also like