473,748 Members | 4,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I populate a Dataset from string values?

I would like to read from Active Directory and populate a dataset to be
passed in a Web Service. I can get the data from AD just fine, but can I
populate a dataset with these values and do a "Return dataSetName" in my web
service?
Nov 19 '05 #1
3 1211
Paul D. Fox wrote:
I would like to read from Active Directory and populate a dataset to be
passed in a Web Service. I can get the data from AD just fine, but can I
populate a dataset with these values and do a "Return dataSetName" in my web
service?


depending on how you are holing the values...
Just keep doing a .Add to the DS after you've created a blank one.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2
Dim dsUser As DataSet = New DataSet
Dim deSearch As DirectorySearch er = New DirectorySearch er

'set the search filter
deSearch.Search Root = de
deSearch.Filter = "(&(objectclass =group))"

'find the first instance
Dim results As SearchResultCol lection = deSearch.FindAl l()
'Create a new table object within the dataset
Dim tbUser As DataTable = dsUser.Tables.A dd("Users")
tbUser.Columns. Add("UserName")
tbUser.Columns. Add("DisplayNam e")
tbUser.Columns. Add("EMailAddre ss")

Dim Result As SearchResult
For Each Result In results

'Create default row
Dim rwDefaultUser As DataRow = tbUser.NewRow()
rwDefaultUser(" UserName") = Result.Properti es("distinguish edname")
rwDefaultUser(" DisplayName") = Result.Properti es("displayname ")
rwDefaultUser(" EMailAddress") = Result.Properti es("email")
tbUser.Rows.Add (rwDefaultUser)

Next

--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"Paul D. Fox" wrote:
I would like to read from Active Directory and populate a dataset to be
passed in a Web Service. I can get the data from AD just fine, but can I
populate a dataset with these values and do a "Return dataSetName" in my web
service?

Nov 19 '05 #3
Perfect! Thanks for your Help!

Paul

"vinay" <vi***@discussi ons.microsoft.c om> wrote in message
news:34******** *************** ***********@mic rosoft.com...
Dim dsUser As DataSet = New DataSet
Dim deSearch As DirectorySearch er = New DirectorySearch er

'set the search filter
deSearch.Search Root = de
deSearch.Filter = "(&(objectclass =group))"

'find the first instance
Dim results As SearchResultCol lection = deSearch.FindAl l()
'Create a new table object within the dataset
Dim tbUser As DataTable = dsUser.Tables.A dd("Users")
tbUser.Columns. Add("UserName")
tbUser.Columns. Add("DisplayNam e")
tbUser.Columns. Add("EMailAddre ss")

Dim Result As SearchResult
For Each Result In results

'Create default row
Dim rwDefaultUser As DataRow = tbUser.NewRow()
rwDefaultUser(" UserName") =
Result.Properti es("distinguish edname")
rwDefaultUser(" DisplayName") = Result.Properti es("displayname ")
rwDefaultUser(" EMailAddress") = Result.Properti es("email")
tbUser.Rows.Add (rwDefaultUser)

Next

--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"Paul D. Fox" wrote:
I would like to read from Active Directory and populate a dataset to be
passed in a Web Service. I can get the data from AD just fine, but can I
populate a dataset with these values and do a "Return dataSetName" in my
web
service?

Nov 19 '05 #4

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

Similar topics

7
6228
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data in the same format as the XSD (the XML file/string was created using this same schema). The XML file/string may contain data for a single table or for several tables at once. The question is:
3
2699
by: Yul | last post by:
Hi, We are in the process of designing an ASP.NET app, where a user will enter some 'Customer ID' to be queried in the database. If the ID is valid, several stored procedures will be called to populate multiple webpages containing customer information. There isn't a one-to-one correlation between the stored procedure and a webpage. In other words, a webpage may have to refer to 1 or more DataTables to populate itself. Therefore, a...
3
2100
by: crjunk | last post by:
I have 4 different databases that I'm having to pull data from in order to populate a datagrid. I am able to do this, but my problem is that because I'm pulling the data from 4 different databases, the data is ordered alphabetically but is grouped by database. Here is an example of what is happening to the data in the datgrid with the code that I have now. DB1 Apple DB1 Bird DB1 Cake
0
1613
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp textbox control which has a 'TextMode' property and when clicked on, displays as a dropdown list with 3 values, I want to have a similar type property with a dropdown style.
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9370
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...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
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...
1
6796
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
4602
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...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.