CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 1/19/2007 7:34:37 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 16 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
Energizeer
Asp.Net User
DataBinding Issues1/19/2007 7:34:37 PM

0/0

Hello,
I'm new to VS 2005 and have been learning for only a few weeks so please forgive me if I seem like a newbie.
I got a number of Videos from LearnVisualStudios.net and they walked me through the drag and drob database set up. I have datagrids which work well and display the data just fine. The thing is, I want to customize the layout of the way the data is shown and edited. I have read many articles about the subject and am now pretty familiar with ADO.NET and all that. However, much of the info I have found doesn't apply to my set up in VS.NET.

VS set up my dataset and the contained DataTables and Table adapters for me. Basically all I want to do is set the text in a textbox or label to a field in my database. This is the code I was trying to use:
[CODE]textBox1.Text = DataSet1.Tables["MainTable"].Rows[0].ItemArray[2].ToString();[/CODE]

Dataset1s intelisence doesn't give me a Tables option so this code won't work.

From what I have learned, VS uses Typed DataSets which don't seem to have the .Tables method like the old ADO.
I have now tried the following:
[CODE]DataSet1 NewDataSet = new DataSet1();
String Testout = NewDataSet.MainTableTBL.Rows[0].ItemArray[0].ToString();
TextBox1.Text = Testout;[/CODE]

But I get an error that there is no row at position 0.

I would really appreciate some help on this matter,

Thanks.

P.S. Please don't tell me to read a Book. I don't have access to a VS.NET book at the moment. Thanks :)

mikepope
Asp.Net User
Re: DataBinding Issues1/21/2007 12:54:50 AM

0/0

I hate to interject what I suspect is a stupid question here, but how come you're not using declarative databinding? e.g.:


<asp:textbox runat="server" id="TextBox1" text='<%# Eval("somefield") %>' />

(See also Databinding Expressions.)


-- Mike Pope

ASP.NET User Education

This posting is provided "AS IS" with no warranties, and confers no rights.

Energizeer
Asp.Net User
Re: DataBinding Issues1/21/2007 1:52:23 PM

0/0

Hi Mike,

TBH I'm not sure how to data bind declaratively :(

I did manage to figure out how to do it via code behind like this:

 

//Set up Table Adapter
DataSet1TableAdapters.MainTableAdapter TBLAdapter = new DataSet1TableAdapters.MainTableAdapter();
//create new instance of the Data Table using the getdatamain method of the adapter
DataSet1.MainTableTBLDataTable MainDataTable = TBLAdapter.GetDataMainTBL();
TextBox1.Text = MainDataTable.Rows[1].ItemArray[0].ToString();

  

 Do you think Declarative data binding would be better?

I will look for some tutorials on this, if you have any other links on this I would appreciate it!

 

Thanks,


 

mikepope
Asp.Net User
Re: DataBinding Issues1/23/2007 11:26:40 PM

0/0

Well, "better" is a term that has multiple dimensions. :-) It depends on a variety of factors, such as whether you want to handle the data binding yourself, for control over the data or whatever reason. Certainly declarative data binding is quicker to get up and running and can be easier to maintain.

Here are some tutorials:

Walkthrough Topics ? ASP.NET Data Access (Visual Studio)

QuickStart Tutorials -- Databinding Expressions

Also, Scott Mitchell has written an extensive set of tutorials on data access in ASP.NET, starting here:

Building and using a 3-tiered data architecture with ASP.NET 2.0

I don't how useful these are to you. Hopefully you can get a good overview of declarative data-binding from the first two. The three-tier tutorials are rather more than just simple data binding, of course.


-- Mike Pope

ASP.NET User Education

This posting is provided "AS IS" with no warranties, and confers no rights.

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Practical C# Charts and Graphics: Advanced Chart and Graphics Programming for Real-world .net Applications Authors: Jack Xu, Anna Y Hsu, Pages: 572, Published: 2007
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Expert C# 2005 Business Objects Authors: Rockford Lhotka, Pages: 668, Published: 2006
Expert VB 2005 Business Objects Authors: Rockford Lhotka, Pages: 670, Published: 2006
Microsoft Visual Basic .NET 2003 Kick Start: Kick Start Authors: Duncan Mackenzie, Andy Baron, Erik Porter, Joel Semeniuk, Pages: 336, Published: 2003
Building Solutions with the Microsoft .NET Compact Framework: Architecture and Best Practices for Mobile Development Authors: Dan Fox, Jon Box, Pages: 367, Published: 2003
Professional ADO.NET 2: Programming with SQL Server 2005, Oracle, and MySQL Authors: Wallace B. McClure, Gregory A. Beamer, John J. Croft, John J. Croft, IV, J. Ambrose Little, Bill Ryan, Phil Winstanley, David Yack, Jeremy Zongker, Pages: 614, Published: 2005
Essential ADO.NET Authors: Bob Beauchemin, Pages: 521, Published: 2002
Internet Applications with Visual FoxPro 6.0 Authors: Rick Strahl, Pages: 400, Published: 1999

Web:
ISSUE-37 - Databinding Apr 25, 2006 ... This issue stems from the resolution of ISSUE-7, and ACTION-29. We provide several methods for expressing missing, null or empty content: ...
VS2005 combobox and databinding issues - DevX.com Forums VS2005 combobox and databinding issues .NET. ... I'm new to all this databinding business, so please let me know if there's any way in which ...
Some databinding issues : The Official Microsoft Silverlight Site Microsoft portal site for the Silverlight development community. Download Silverlight, post to the forums, read Silverlight blogs and learn ...
CalendarExtender + Validator and DataBinding Issues - ASP.NET Forums CalendarExtender + Validator and DataBinding Issues. Last post 02-08-2007 11:52 PM by Harshal Chavan. 5 replies. Sort Posts: ...
MSDN Windows Presentation Foundation (WPF) ListBox in a ... ListBox in a ListViewItem Data Binding issues. ... ListBox in a ListViewItem Data Binding issues. Hi, Many many many many...............Thanks It works ! ...
Simon Hart: Databinding issues on the Compact Framework <= 2.0 Databinding issues on the Compact Framework <= 2.0. I had a requirement the other day to databind an alphanumeric id - reasons for which are not that ...
DateTimePicker control - need help with databinding issues ... I have a form with a bunch of data bound controls. Most are simply text boxes. I have a datepicker control that is also databound, and I'm having some ...
Announcing Java ClassBuilder: the solution to Java's data binding ... Announcing Java ClassBuilder: the solution to Java's data binding issues. Options ..... in SAXReader.java could you do a quick debug to see if the issue is ...
Databinding WG Teleconference -- 2 May 2006 < pauld > http://www.w3.org/2005/06/tracker/databinding/issues/33 ... this issue goes above and beyond ISSUE-4 - collection of known databinding tools ...
ASP.NET Databinding issues (ASP.NET 2.0) - ASP - Web Development I have some code that used to work (yeah I know, a common problem).I originally had a FormView with the corresponding Insert/Edit Templates etc, ...

Videos:
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...
XML - Building XML Web Application Level 1 The XML - Building XML Web Application Level 1 is part of KeyStone Learning Systems library of more than 1,200 CD-ROM and video-based information tec...




Search This Site:










xpath document and loadxml

is it possible to create a user control that has a contentplaceholder?

controls/featuredad.asdx

is there a free calendar with link possibilities?

custom login module.

hi, friends help me plz

treeviewmenu and tooltip on nodes

ssl links on port 80

need advice urgent?

get windows domain name and userid

remote security

custom modules tutorial

working with photos in visual web developer express 2008

logon problem

the simple one

modifying ibuyspy with visual studin .net

createuserwizard - how to change the image for create user button

how to delete browser cache?

appearanceeditorpart - changing label texts?

databinding user controls

wrapping text around the image

direction to learning how to pa a javascript plz

unable to login when using membership tables within my app

looking for suggestions on authentication method

newbie - suddenly i can't access module properties

yaf for dnn can not use mult-portal?

.text with ms access?

happy as a bumblebee; the copyrighter is free!

sitemapnode url with two keys

does anyone have a working sqltableprofileprovider working in vwd c#

 
All Times Are GMT