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 January 18th, 2008, 09:17 AM
Registered User
 
Join Date: Jan 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQLDatasource

I very new to ASP.net and programming in general and I have a SQLDatasource question.
My connect string is as follows:
Dim DataSource As New SqlDataSource()
        DataSource.ConnectionString = ConfigurationManager.ConnectionStrings("Connection String1").ToString()
        DataSource.SelectCommandType = SqlDataSourceCommandType.Text
        DataSource.SelectCommand = "SELECT Table_Name FROM Tables"

How do I get the Table_name into a text box?


 
Old February 28th, 2008, 12:38 AM
Authorized User
 
Join Date: Jun 2007
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hericles
Default

Hi, not sure if you'll still after a reply for this post but if you run that SQL statement and store the result in a variable (or dataset, datatable), that result will be able to be applied to the text box.
E.g. If you executed the command like this
Dim result as String
result = cmd.ExecuteScalar()
 the result could then be placed in the text box
TextBox.Text = result

Hope that helps,
Steve

"I will prepare and one day my chance will come."





Similar Threads
Thread Thread Starter Forum Replies Last Post
sqldatasource imjayakumar ASP.NET 2.0 Professional 3 May 21st, 2007 01:56 PM
sqldatasource imjayakumar Crystal Reports 0 May 19th, 2007 03:12 AM
sqldatasource imjayakumar ASP.NET 2.0 Professional 0 May 19th, 2007 02:58 AM
CheckBoxList and SqlDataSource extendedram ASP.NET 2.0 Basics 2 June 8th, 2006 02:54 PM
SQLDataSource bmains ASP.NET 2.0 Basics 1 December 19th, 2004 09:12 AM





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