473,763 Members | 7,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebServices exposing DataSet, Consumed by a datagrid

TK
Hi,

I need help on datagrid. I have a dataset exposed as a webservice. I do
have a web application that is supposed to consume the service on a
datagrid.

The problem is that in the datagrid only the first record is displayed in
all rows. I have gone throught the code and properties and i dont seem to
spot the problem. I have done similar thing (different webservice and
different dataset) and nothing seem to be behaving.

When I test the webservice, it returns different records, but the DG does
not! i am actually using templates for the columns.

have anyone experienced this or have a solution to this problem. below is a
part of the code.

---

managerID = Context.User.Id entity.Name;

adSearchResults .Text = "You are logged in as " + managerID +
"@domain.or g";
//fill the datagrid
//old
//sqlDataAdapter1 .Fill(dsApplied Leave1);
//bind control to the data set
leave.PreviousL eaveDays.Admini stratorFacade ws =
new leave.PreviousL eaveDays.Admini stratorFacade() ;
ws.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
DataSet DSManager = new DataSet();
DSManager = ws.GetPendingLe aveStatusByMana ger(managerID);
leaveStatusByMa nager.Merge(DSM anager);
//ws.GetPendingLe aveStatusByMana ger(managerID)) ;

if (!Page.IsPostBa ck)
{
//DataGrid1.DataS ource = DSManager;
DataGrid1.DataB ind();
}

}

--

private void DataGrid1_Updat eCommand(object source,
System.Web.UI.W ebControls.Data GridCommandEven tArgs e)
{

//identify the row
string key = DataGrid1.DataK eys[e.Item.ItemInde x].ToString();
//value of the field to change
//TextBox txtEmployee = (TextBox)e.Item .Cells[1].Controls[0];
//txtEmployee.Ena bled = false;
//e.Item.Cells[3].Enabled = false;
DataGrid1.DataB ind();

string changedApproval Type,mgrComment s;

// set the value from what the mananger sets
DropDownList ddl =
(DropDownList)e .Item.FindContr ol("ddlMgrAppro valEdit");
//Label mgrLabel = (Label)e.Item.F indControl("lbl MgrCommentsEdit ");
TextBox mgrTB = (TextBox)e.Item .FindControl("t xtComments");
Label lblUserID = (Label)e.Item.F indControl("lbl EmployeeEdit");
//assign the value of combo to string
changedApproval Type = ddl.SelectedIte m.Value.ToStrin g();
//mgrComments = mgrLabel.Text;
mgrComments = mgrTB.Text;
DataSet newSet = new DataSet();

DataRow row = leaveStatusByMa nager.leaveAppl ication[e.Item.DataSetI ndex];
row[leaveStatusByMa nager.leaveAppl ication.Columns["mgrApprova l"].Caption]
= changedApproval Type;
row[leaveStatusByMa nager.leaveAppl ication.Columns["mgrComment "].Caption]
= mgrComments;

if (leaveStatusByM anager.HasChang es())
{

leave.PreviousL eaveDays.Admini stratorFacade ws =
new leave.PreviousL eaveDays.Admini stratorFacade() ;
ws.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
leave.PreviousL eaveDays.LeaveS tatus diffLeaveStatus =
new leave.PreviousL eaveDays.LeaveS tatus();
diffLeaveStatus .Merge(leaveSta tusByManager.Ge tChanges());
diffLeaveStatus = ws.UpdateLeaveS tatus(diffLeave Status);
leaveStatusByMa nager.Merge(dif fLeaveStatus);
//ws.UpdateLeaveS tatus(diffLeave Status);
//leaveStatusByMa nager.Merge(dif fLeaveStatus);
}

DataGrid1.EditI temIndex = -1;
// bind the datagrid
DataGrid1.DataB ind();
//set mail addresses
string hrAddress = "my**@domain.or g";
string supAddress = managerID+"@dom ain.org";
string userAddress = lblUserID.Text+ "@domain.or g";
//notify HR of the approval or decline
notifyHR(change dApprovalType, hrAddress, supAddress, userAddress);
Response.Redire ct("approve.asp x");

}
Nov 16 '05 #1
0 1396

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

Similar topics

7
354
by: Richard Myers | last post by:
Hello. I am getting an InvalidCastException which has revealed yet more of my ignorance. I cant believe i dont already know this and haven't encountered it before until now. I am consuming a dataset from a webservice. I wrote both the server and client apps and the both use the same middle teir. I fill a dataset on the server that has a relationship between two of the tables inside. The relationship is between two strongly typed tables...
3
1390
by: androoo | last post by:
Hi all I have read both scott mitchells (4 guys) articles on why he doesnt like to use datasets from webservices and I have some questions if anyone has some experience in this. How secure is my app if i pass a dataset from a webservice to my application ? What is the future for webservices and passing back data in .net2? Ive
3
1620
by: Prozon | last post by:
Hi! I have problem naming my webservices. One of the problem is that I got naming conventions between my webservices and dataset that the services uses. Can someone please give me a good example of how to name a webservice-class which handles articles for example? And what is a good name for the "corresponding" dataset/s used? By now the name of the dataset is just Article. What is a good name for the webreference?
0
1543
by: Pasho | last post by:
hi I have been facing problem using C# webservices (secured using SSL). In my webservice(secured with SSL) It works fine if I try to access data from database through dataset. If I try to confirm the dataset with schema using following line ds.ReadXMLSchema(schema) and then access data through dataset schema is a url to my xsd file. schema = https://localcomputer/sample/trace.xsd
4
3196
by: nixon | last post by:
Hi there! Im trying to build a 3 tier application that uses a smartclient in the "view" layer. The communication between the smartclient and the server should be webservices because of potentiel firewall issues. I´ve looke at to smartclient demos to figure out how the experts do the stuff, design and overall architecture, Microsofts IssueVision and TaskVision. These applications uses DataSet´s to communicate between the layers and
0
2778
by: Dino Chiesa [Microsoft] | last post by:
If you develop WinForms or WebForms clients that consume webservices, and display the results in a DataGrid, you may be interested in a helper class I found recently. It is the CollectionView class described at: http://dotnetjunkies.com/WebLog/bsblog/archive/2004/09/02/24116.aspx This can help with sorting and filtering of collections, when displayed in a DataGrid. A DataGrid is a powerful data display widget. One of the interesting...
1
1159
by: Jothi | last post by:
Hi, We are a small application development group. We have about 100 Users who primarily use Microsoft Related Products. Our Application Development was purley based on a CLient Server Model using Visual Basic and SQL Server. We plan to move forward to the .NET environment. We plan to develop applications with ASP.NEt as well as VB.NET. Right now we have some COM components or DLL's that we use. For example we
2
1101
by: Ing. Davide Piras | last post by:
Hi there I've my .NET 2.0 C# WebApplication which exposes some WebMethod, I pass tablename, username, password and I get a DataSet with some data (actually the size of the dataset is not a problem since when there are more than 200 records I get the dataset page by page, using startindex and pagesize parameters)... .... everything works fine but I feel not safe since if someone sniffs the webmethod call can call it with the same...
6
1488
by: NewsGuy | last post by:
Hello I'm concidering better ways to architecture our VB.Net Webservices project. Below is a draft of what I thought would be a decent way to go about it, I was wondering about other peoples thoughts. I thought maybe a half business object half dataset approach is feasable...Im not sure... Teir1 - WebService wsTblClient Method Create() Method Read() Method Update()
0
9386
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
9997
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
9937
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
9822
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
7366
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
6642
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
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
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.