Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2006, 05:28 AM
Registered User
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Vinay Chugh
Default Very Urgent Help Needed

Hi!
I am new to ASP.NET and is using to make an application with C# as scripting Language.
I have query that:
I have one RadioButtonList Control with two Items and when user checks the one then the search will be done according to the selected option.
Now i have one text box and a List Box.When user clicks for say Manufacturer Name option of Radio..., and enters some text in Text Box and then clicks search Button, then List Box must get updated with all the Manufacturer Names containing the entire Text written in Text Box.
PROBLEM: i am facing is that when I enter the Text in Text Box and and click search button, list box doesnt get populated but when i change the select query with specific alphabet it works fine but i want the other way round.PLEASE HELP ASAP !

A code snippet is:

<%@ Page Language="C#" autoeventwireup="True" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<script runat="server">

   void Search_Click(object Source, EventArgs e)
    {
       if (RadioButtonList1.SelectedIndex == 0)
       {

          string val = TextBox1.Text;
          string connectionstring;
          string queryString;
          DataSet Data = new DataSet();
          OleDbConnection dbconnection;
          OleDbDataAdapter dataAdapter;
          connectionstring = "Provider=Microsoft.Jet.OLeDb.4.0;DATA SOURCE=" +
                      Server.MapPath("\\Database\\New_Tool.mdb") ;
          queryString = "SELECT Company_Name FROM CompanyName WHERE Company_Name LIKE '@' + val +'@' ";

          dbconnection = new OleDbConnection(connectionstring);
          dbconnection.Open();
          dataAdapter = new OleDbDataAdapter(queryString, dbconnection);

          dataAdapter.Fill(Data,"Company_Name");

          ListBox1.DataSource = Data;
          ListBox1.DataTextField = "Company_Name";
          ListBox1.DataValueField = "Company_Name";
          ListBox1.DataBind();
         }

      }



Vinay Chugh

If I rest, I will rust ! Let's share the knowledge !
 
Old June 7th, 2006, 12:32 AM
Registered User
 
Join Date: Jun 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Vinay Chugh
Default

Please Anybody can provide the solution to the problem. My code is not working and i am deeply stuck!

Have tried with % instead of @ but to noe use

Vinay Chugh

If I rest, I will rust ! Let's share the knowledge !





Similar Threads
Thread Thread Starter Forum Replies Last Post
Needed Very Urgent ndrnathan C# 0 June 8th, 2007 07:43 AM
urgent help needed ramabharti Javascript How-To 2 November 21st, 2006 01:17 AM
Urgent Help Needed rameshnarayan XSLT 0 September 19th, 2005 03:46 AM
urgent help needed sugandh .NET Web Services 0 January 10th, 2004 12:44 PM
URGENT Help needed scott Access 12 November 16th, 2003 03:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.