473,883 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.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 ObjectDataSourc e to the TableAdapter.
To send the email i've added a commandbutton to the detailsview and use the
clickeventmetho d. 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 1991
I've crawled the "complete" Google now and all solutions i've found were by
accessing the controls directly... Like DetailsView1.Fi ndControl("modu les")
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 "AutoBindin g" somehow. Is this
possible somehow?

Thanks
Martin
Oct 3 '07 #2
"Martin Frey" <ma*********@lo gicacmg.comwrot e in message
news:Op******** ******@TK2MSFTN GP02.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*********@lo gicacmg.comwrot e in message
news:Ov******** *****@TK2MSFTNG P04.phx.gbl...
I've crawled the "complete" Google now and all solutions i've found were
by accessing the controls directly... Like
DetailsView1.Fi ndControl("modu les") 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 "AutoBindin g"
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
4051
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
1485
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 all part of these live webcasts. This is a great way to get educated, engaged, and enlightened on Microsoft ASP.NET. Register for all 12 webcasts at http://msdn.microsoft.com/asp.net/using/training/webcasts. ...
1
2984
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 Visual Studio .net Professional trial version 2003. I have been reading up various documents that discuss - "What is Microsoft .Net" and have found some enlightening information. I'm trying to write a paper on security and software...
9
3128
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
3373
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 speed. I like books with practical exercises, and also with test questions (like cert books) *2*
5
2543
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 C# (.NET) really functionally equivalent? I had read that although they are very similar, C# does extend functionality further than VB.NET; however, when I searched for pages regarding this, I could not find any.
21
2875
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 applications or do I need to learn both VB.NET and ASP.NET. Thank you. TAM
0
1449
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 all part of these live webcasts. This is a great way to get educated, engaged, and enlightened on Microsoft ASP.NET. Register for all 12 webcasts at http://msdn.microsoft.com/asp.net/using/training/webcasts. ...
3
3059
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 mak sure that the server is running correctly . verify that there are o syntax errors in the web.config... i check the IIS, it is running correctly, also the webconfig so what am i sposed to to do be able to run it
9
2767
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 site (http://localhost) and I get error 'HTTP/1.1 503 Service Unavailable' when trying to start a new ASP.NET project. I uninstalled IIS and reinstalled IIS, and the under construction default page comes up normally, I ran aspnet_regiis -i and then...
0
9792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10745
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10417
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9575
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7972
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7130
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5798
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3234
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.