473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

.NET-Noob and Databinding (DataSet, DetailsView)

Hello guys,
im new to asp.net and im trying to get me used to it. I've managed to create
webpages with detailviews, databinding and datasources. Adding or inserting
data went very well and, after a while, very fast.

Now i ran into a problem with accessing the data. I need to send an email to
the administrator with the data the user has selected instead of calling the
update method. Everything i've build up via the designer or the wizards.
Created a DataTable with a TableAdapter within a DataSet.xsd and a
DetailsView which is bound via an ObjectDataSource to the TableAdapter.
To send the email i've added a commandbutton to the detailsview and use the
clickeventmethod. But i was not able to get the data in a "clean" way. I
thought the DataTable would be my businessobject, but i have not managed to
access this data via an attribute or method or whatever. At the moment i
solved it with accessing the Controls within the DetailsView directly and
getting f.e. the Text attribute from the TextBoxes. But i have the feeling
that it should be alot easier..? Shouldnt i be able to read the data i need
from a businessobject instead? But i was not able to find a method or field
within the DetailsView or DataSource to get access to such a businessobject.

Would be nice to get some help here.
Thanks alot
Martin
Oct 2 '07 #1
3 1967
I've crawled the "complete" Google now and all solutions i've found were by
accessing the controls directly... Like DetailsView1.FindControl("modules")
and so on. Is this really the way to go?

Comming from the Java world i'd expected a dataobject that i can use in the
backingclass to access the data. The DataTable seems the correct one. But
since i use the DataSource binding i was not able to find a field that
directs me to the current datatable of the detailsview or the assigned
tableadapter.
I'm able to create a DataTable by myself and also filling this one through
the tableadapter. But this is completely new data and not the one the user
entered.

I now have another idea but im not sure if this is working. Within the
pageload method i can create and fill a datatable with the tableadapter. Am
i able to bind the detailsview on this datatable instead of the datasource?
I'd say for this solution i need to disable "AutoBinding" somehow. Is this
possible somehow?

Thanks
Martin
Oct 3 '07 #2
"Martin Frey" <ma*********@logicacmg.comwrote in message
news:Op**************@TK2MSFTNGP02.phx.gbl...
At the moment I solved it with accessing the Controls within the
DetailsView directly and getting e.g. the Text attribute from the
TextBoxes.
Yep, that's certainly how I'd do it...
But I have the feeling that it should be alot easier..?
How much easier would you like it to be...?
Would be nice to get some help here.
Sounds like you're on the right track...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 3 '07 #3
Why don't you manually bind your details view to a dataset, skipping the
datasource. that will give you more control over the underlying data.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless Author Plug
OWC Black Book 2nd Edition
Exclusively on www.lulu.com/owc
$24.99
"Martin Frey" <ma*********@logicacmg.comwrote in message
news:Ov*************@TK2MSFTNGP04.phx.gbl...
I've crawled the "complete" Google now and all solutions i've found were
by accessing the controls directly... Like
DetailsView1.FindControl("modules") and so on. Is this really the way to
go?

Comming from the Java world i'd expected a dataobject that i can use in
the backingclass to access the data. The DataTable seems the correct one.
But since i use the DataSource binding i was not able to find a field that
directs me to the current datatable of the detailsview or the assigned
tableadapter.
I'm able to create a DataTable by myself and also filling this one through
the tableadapter. But this is completely new data and not the one the user
entered.

I now have another idea but im not sure if this is working. Within the
pageload method i can create and fill a datatable with the tableadapter.
Am i able to bind the detailsview on this datatable instead of the
datasource? I'd say for this solution i need to disable "AutoBinding"
somehow. Is this possible somehow?

Thanks
Martin

Oct 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
0
by: Georgeo Pulikkathara[MS] | last post by:
ASP.NET Webcast Week - January 19 - 23, 2004 Learn about ASP.NET from the experts! These free webcasts are live and interactive. Live code demos and attendees asking in depth engaging questions are...
1
by: Novice | last post by:
Hi all, I am a C++ and Java developer with over 3 years of industry experience. I've written low level C++ code, in addition to web clients that use web services. I've just recently installed the...
9
by: gulu man | last post by:
Hi, What is the substitute for COM objects in .NET? How can I create something similar to com in .net? Is it still possible? Thank you
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
5
by: Saga | last post by:
Hi all, I just read the thread by the same name posted on Jun 15, 9:45 AM, but I am looking at it from a different point of view. I came across this question in terms of functionality. Are VB and...
21
by: TAM | last post by:
Hi, I read that ASP.NET uses VB.NET instead of VBScript. I also read that ASP.NET is a subset of VB.NET. So if I learn VB.NET first then do I have the knowledge for programming ASP.NET...
0
by: Georgeo Pulikkathara[MS] | last post by:
ASP.NET Webcast Week - January 19 - 23, 2004 Learn about ASP.NET from the experts! These free webcasts are live and interactive. Live code demos and attendees asking in depth engaging questions are...
3
by: hussein | last post by:
'm not bale to run my projec on the 2000 server, he error was: error while trying to run project: unable to start debugging on the web server.erver side error occurred on sending debug HTTP request...
9
by: Bob | last post by:
Is ASP.NET 1.1 available on the 64 bit extended version of Windows 2003 Server? When I install VS.NET 2003 I then get Service Unavailable from IIS when navigating to the main under construction...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.