Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / January 2006

Tip: Looking for answers? Try searching our database.

displaying Accessdatasource field in textbox using ASP.Net and VS.Net 2005 ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luqman - 20 Jan 2006 10:17 GMT
How can I display any field value in textbox of sqldatasource using VS.Net
2005 ?

Say : Dim x as new AccessDataSource
X.connectionstring="Data source="D:\mydb.mdb"
X.Selectcommand="Select CompanyName from customers"

Textbox1.text= ???     <-------- I need to display CompanyName Field in this
textbox, how can I  ?

Best Regards,

Luqman
Christopher Reed - 23 Jan 2006 04:18 GMT
How many values do you want to put into your TextBox?  Your SQL select
statement will probably return back more than one value.
Signature

Christopher A. Reed
"The oxen are slow, but the earth is patient."

> How can I display any field value in textbox of sqldatasource using VS.Net
> 2005 ?
[quoted text clipped - 10 lines]
>
> Luqman
Luqman - 24 Jan 2006 09:28 GMT
Hi,

I want to display each field in a separate textbox, so if I have 2 fields,
say, companycode and companyname, I want to display both of them in two
textboxes.

For eg.

Textbox1.text= companycode
Textbox2.text=companyname

But I don't know the syntax, Any idea please ?

Best Regards,

Luqman

> How many values do you want to put into your TextBox?  Your SQL select
> statement will probably return back more than one value.
[quoted text clipped - 13 lines]
>>
>> Luqman
Christopher Reed - 24 Jan 2006 12:39 GMT
You might consider using a FormView which is a template-based data control.
So, within your ASPX page, you could do something like this:

<asp:FormView id="FormView1" runat="server"
DataSourceID="AccessDataSource1">
  <ItemTemplate>
     <asp:TextBox id="TextBox1" runat="server" Text='<%#
Eval("CompanyCode") %>' />
     <asp:TextBox id="TextBox2" runat="server" Text='<%#
Eval("CompanyName") %>' />
  </ItemTemplate>
</asp:FormView>
<asp:AccessDataSource id="AccessDataSource" runat="server"
     ConnectionString = "Data source=D:\mydb.mdb"
     SelectCommand = "Select CompanyCode, CompanyName from customers" />

Depending your actual set up, you may have to tweak the above a little.
Signature

Christopher A. Reed
"The oxen are slow, but the earth is patient."

> Hi,
>
[quoted text clipped - 30 lines]
>>>
>>> Luqman
Luqman - 25 Jan 2006 09:36 GMT
Ok thanks for your help, I will definitely try out.

Best Regards,

Luqman

> You might consider using a FormView which is a template-based data
> control. So, within your ASPX page, you could do something like this:
[quoted text clipped - 47 lines]
>>>>
>>>> Luqman

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.