Smita
Serialize the data Table and return it...(actually send a dataset which
contains your data table)
Plashkari
----- Original Message -----
From: "Piyush Prakash" <piyush_prakash@i...>
To: "ASPX_Professional" <aspx_professional@p...>
Cc: <smita@j...>
Sent: Thursday, March 13, 2003 12:25 PM
Subject: [aspx_professional] RE: aspx_professional digest: March 11, 2003
Hi Smita,
No, You can't return a DataTable from a WebMethod .
It's wrongly mentioned in MS Documentation as passByValue.
I wasted quite some time on it. :-)
Regds,
Piyush
-------------------------------------------------
Piyush Prakash
Software Engineer ,
Infosys Technologies Ltd,
Bangalore ,India
Ph : 91-80-51174701 (Direct) .
91-80-8520261 (Extn : 54701).
-------------------------------------------------
-----Original Message-----
From: ASPX_Professional digest [mailto:aspx_professional@p...]
Sent: Wednesday, March 12, 2003 5:39 AM
To: aspx_professional digest recipients
Subject: aspx_professional digest: March 11, 2003
-----------------------------------------------
When replying to the digest, please quote only
relevant material, and edit the subject line to
reflect the message you are replying to.
-----------------------------------------------
The URL for this list is:
http://p2p.wrox.com/list.asp?list=aspx_professional
ASPX_PROFESSIONAL Digest for Tuesday, March 11, 2003.
1. Can we return a Datatable from WebMethod?
2. Overhead:
3. RE: Create virtual directory in asp.net web project
4. How to reflect the changes back to Database??
5. Date field
6. Re: find Str in Str **be fast please**
7. RE: Date field
8. RE: Date field
9. RE: Date field
10. click event affects render process
11. Re: Nested Repeaters
----------------------------------------------------------------------
Subject: Can we return a Datatable from WebMethod?
From: smita <smita@j...>
Date: Tue, 11 Mar 2003 12:05:44 +0530
X-Message-Number: 1
Hi all,
I want to return a DataTable from my Web Service/Web method to the
client calling that method. How do I achieve this? Is it possible to
do this or is there any other way to do this?
Please do reply as soon as possible....
Thanx in advance
smita
----------------------------------------------------------------------
Subject: Overhead:
From: "Robert Sindall" <rsindall@z...>
Date: Tue, 11 Mar 2003 11:48:56 -0000
X-Message-Number: 2
Hi
By adding: EncType="Multipart/Form-Data" to the form tag. what added
overhead is caused?
Thanks
Robert Sindall
----------------------------------------------------------------------
Subject: RE: Create virtual directory in asp.net web project
From: "Mansoor Shahi" <ma_s_m@y...>
Date: Tue, 11 Mar 2003 12:24:20
X-Message-Number: 3
thanks for your help,
i used this class and here is the result:
when i use it in my windows application it works well( make virtual
directory without any problem) , but in my web application the same code
makes an error like this : access is denied.
is it because of user definition in process model section in
machine.config?
and how can i solve this problem?
thanks again
shahi
----------------------------------------------------------------------
Subject: How to reflect the changes back to Database??
From: smita <smita@j...>
Date: Tue, 11 Mar 2003 19:18:33 +0530
X-Message-Number: 4
hi all,
i'm playing with database tables by getting their data in datatables
i'm changing the datatables through my code and want the changes
to get reflected to my original database tables.
how do i achieve this?? is it possible??
if not is there any other way to do this??
thanx in advance
waiting for reply...
regards,
smita
----------------------------------------------------------------------
Subject: Date field
From: Dan Deffner <ddeffner@a...>
Date: Tue, 11 Mar 2003 08:10:14 -0600
X-Message-Number: 5
Good Day,
The code below is suppose to take the current date and be
inserted
into the "WHERE" parameter in the SQL statement. This in turn would
cause
the datagrid to return only the events for the current day. However I
am
not quite connecting here on as to how to pass a String or Date field to
the
Date parameter in the code below. I hardcoded the Date parameter
"Date=#3/11/2003#" and it works. However when I try to pass the either
"Date=dDate" or Date=#dDate# I am getting errors.
I have tried Dim dDate as Date giving it 3/11/2003 and dDate as String
and
giving it #3/11/2003# with no luck, would anyone out there know what I
may
be doing wrong.
See code below for information
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data" %>
<script language="VB" runat="server">
sub Page_Load(sender as Object, e as EventArgs)
'Information for testing strings against Access
Dim dDate as String
dDate = #3/11/2003#
'This is abnormal behavior. When the Date is hardcoded
as
shown in the "WHERE" clause it works.
'When it is assigned to a variable, it fails. What am I
missing?
Dim connString as String
connString = "PROVIDER=MICROSOFT.Jet.OLEDB.4.0;DATA
SOURCE="
& _
"C:\Inetpub\wwwroot\-------\------\calendar.mdb;"
Dim objConnection as OleDbConnection
objConnection = New OleDbConnection(connString)
objConnection.Open()
Dim strSQL as String = "Select * From SchoolCalendar
WHERE
Date=#3/11/2003#"
Dim objCommand as OleDbCommand
objCommand = New OleDbCommand(strSQL, objConnection)
Dim objDataReader as OledbDataReader
objDataReader
objCommand.ExecuteReader(CommandBehavior.CloseConnection)
dgEvents.DataSource = objDataReader
dgEvents.DataBind()
objDataReader.Close()
end sub
</script>
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%"
border="0">
<TR>
<TD>
<form id="Form1" runat="server">
<asp:Calendar id="Calendar1"
runat="server">
</asp:Calendar></form>
</TD>
<TD>
<P><asp:DataGrid ID="dgEvents"
runat="server" /></P>
</TD>
</TR>
</TABLE>
Thanks in advance.
Dan Deffner
----------------------------------------------------------------------
Subject: Re: find Str in Str **be fast please**
From: "Rodney Majola" <MajolaR@a...>
Date: Tue, 11 Mar 2003 16:13:06 +0200
X-Message-Number: 6
Please make sure that you've got the case right. If you're using a tool
like ASP.Net Matrix, u won't have code completion, but there's a tab at
the bottom where u can browse the .Net framework classes and methods.
Hope it helps ...
-----Original Message-----
From: Liviu Rau [mailto:lrau@t...]
Sent: Monday, March 10, 2003 5:11 PM
To: ASPX_Professional
Subject: [aspx_professional] Re: find Str in Str **be fast please**
But you have IndexOf in C# !
str.IndexOf("tofind", startFromHere, count);
Don't you use code completion ?
Liviu Rau
----- Original Message -----
From: "Hovik Melkomian" <melvik@b...>
To: "ASPX_Professional" <aspx_professional@p...>
Sent: Saturday, March 08, 2003 10:36 PM
Subject: [aspx_professional] find Str in Str **be fast please**
> Hi there:
> sorry for my question but I have to ask :)
>
> how can I search a string in a string?! (like indexOf() in JavaScript)
> I use C#.net, please help to find out my problem.
>
> Thanks in advance,
> Hovik.
>
>
----------------------------------------------------------------------
Subject: RE: Date field
From: "Harvey, James" <James.Harvey@b...>
Date: Tue, 11 Mar 2003 14:20:28 -0000
X-Message-Number: 7
Have you tried:
Dim strSQL as String =3D "Select * From SchoolCalendar WHERE Date=3D#" &
Da
te.Today.ToShortDateString & "#"
James
-----Original Message-----
From: Dan Deffner [mailto:ddeffner@a...]
Sent: 11 March 2003 14:10
To: ASPX_Professional
Subject: [aspx_professional] Date field
Good Day,
The code below is suppose to take the current date and be
inserted
into the "WHERE" parameter in the SQL statement. This in turn would
cause
the datagrid to return only the events for the current day. However I
am
not quite connecting here on as to how to pass a String or Date field to
the
Date parameter in the code below. I hardcoded the Date parameter
"Date=3D#3/11/2003#" and it works. However when I try to pass the
either
"Date=3DdDate" or Date=3D#dDate# I am getting errors.
I have tried Dim dDate as Date giving it 3/11/2003 and dDate as String
and
giving it #3/11/2003# with no luck, would anyone out there know what I
may
be doing wrong.
See code below for information
<%@ Page Language=3D"VB" Debug=3D"true" %>
<%@ Import Namespace=3D"System.Data.OleDb" %>
<%@ Import Namespace=3D"System.Data" %>
<script language=3D"VB" runat=3D"server">
sub Page_Load(sender as Object, e as EventArgs)
=09
'Information for testing strings against Access
Dim dDate as String
dDate =3D #3/11/2003#
'This is abnormal behavior. When the Date is hardcoded
as
shown in the "WHERE" clause it works.
'When it is assigned to a variable, it fails. What am I
missing?
=09
Dim connString as String
connString =3D "PROVIDER=3DMICROSOFT.Jet.OLEDB.4.0;DATA
SOURCE=3D"
& _
=09
"C:\Inetpub\wwwroot\-------\------\calendar.mdb;"
=09
Dim objConnection as OleDbConnection
objConnection =3D New OleDbConnection(connString)
objConnection.Open()
=09
Dim strSQL as String =3D "Select * From SchoolCalendar
WHERE
Date=3D#3/11/2003#"
=09
Dim objCommand as OleDbCommand
objCommand =3D New OleDbCommand(strSQL, objConnection)
=09
Dim objDataReader as OledbDataReader
objDataReader =3D
objCommand.ExecuteReader(CommandBehavior.CloseConnection)
=09
dgEvents.DataSource =3D objDataReader
dgEvents.DataBind()
=09
objDataReader.Close()
end sub
</script>
=09
<TABLE id=3D"Table1" cellSpacing=3D"1" cellPadding=3D"1"
width=3D"100%"
border=3D"0">
<TR>
<TD>
<form id=3D"Form1" runat=3D"server">
<asp:Calendar id=3D"Calendar1"
runat=3D"server">
</asp:Calendar></form>
</TD>
<TD>
<P><asp:DataGrid ID=3D"dgEvents"
runat=3D"server" /></P>
</TD>
</TR>
</TABLE>
Thanks in advance.
Dan Deffner
=09
leave-aspx_professional-1629744L@p...
rox.com.
**********************************************************************
This electronic mail message, including any attachments, is a
confidential
communication exclusively between Babcock International BES Division and
th
e intended recipient(s) indicated as the addressee(s).
It contains information which is private and may be proprietary or
covered
by legal professional privilege.
If you receive this message in any form and you are not the intended
recipi
ent you must not review, use, disclose or disseminate it.
We would be grateful if you could contact the sender upon receipt and in
an
y event you should destroy this message without delay.
Anything contained in this message that is not connected with the
business
of Babcock International BES Division is neither endorsed by nor is the
lia
bility of this company.
Babcock International BES Division
Telephone: +44 (0) 1383 412131
Website: www.babcockbes.co.uk
**********************************************************************
----------------------------------------------------------------------
Subject: RE: Date field
From: Dan Deffner <ddeffner@a...>
Date: Tue, 11 Mar 2003 08:25:55 -0600
X-Message-Number: 8
No. I hadn't thought like that. That would be something to try.
Thanks
-----Original Message-----
From: Harvey, James [mailto:James.Harvey@b...]
Sent: Tuesday, March 11, 2003 8:20 AM
To: ASPX_Professional
Subject: [aspx_professional] RE: Date field
Have you tried:
Dim strSQL as String = "Select * From SchoolCalendar WHERE Date=#" &
Date.Today.ToShortDateString & "#"
James
-----Original Message-----
From: Dan Deffner [mailto:ddeffner@a...]
Sent: 11 March 2003 14:10
To: ASPX_Professional
Subject: [aspx_professional] Date field
Good Day,
The code below is suppose to take the current date and be
inserted
into the "WHERE" parameter in the SQL statement. This in turn would
cause
the datagrid to return only the events for the current day. However I
am
not quite connecting here on as to how to pass a String or Date field to
the
Date parameter in the code below. I hardcoded the Date parameter
"Date=#3/11/2003#" and it works. However when I try to pass the either
"Date=dDate" or Date=#dDate# I am getting errors.
I have tried Dim dDate as Date giving it 3/11/2003 and dDate as String
and
giving it #3/11/2003# with no luck, would anyone out there know what I
may
be doing wrong.
See code below for information
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data" %>
<script language="VB" runat="server">
sub Page_Load(sender as Object, e as EventArgs)
'Information for testing strings against Access
Dim dDate as String
dDate = #3/11/2003#
'This is abnormal behavior. When the Date is hardcoded
as
shown in the "WHERE" clause it works.
'When it is assigned to a variable, it fails. What am I
missing?
Dim connString as String
connString = "PROVIDER=MICROSOFT.Jet.OLEDB.4.0;DATA
SOURCE="
& _
"C:\Inetpub\wwwroot\-------\------\calendar.mdb;"
Dim objConnection as OleDbConnection
objConnection = New OleDbConnection(connString)
objConnection.Open()
Dim strSQL as String = "Select * From SchoolCalendar
WHERE
Date=#3/11/2003#"
Dim objCommand as OleDbCommand
objCommand = New OleDbCommand(strSQL, objConnection)
Dim objDataReader as OledbDataReader
objDataReader
objCommand.ExecuteReader(CommandBehavior.CloseConnection)
dgEvents.DataSource = objDataReader
dgEvents.DataBind()
objDataReader.Close()
end sub
</script>
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%"
border="0">
<TR>
<TD>
<form id="Form1" runat="server">
<asp:Calendar id="Calendar1"
runat="server">
</asp:Calendar></form>
</TD>
<TD>
<P><asp:DataGrid ID="dgEvents"
runat="server" /></P>
</TD>
</TR>
</TABLE>
Thanks in advance.
Dan Deffner
**********************************************************************
This electronic mail message, including any attachments, is a
confidential
communication exclusively between Babcock International BES Division and
the
intended recipient(s) indicated as the addressee(s).
It contains information which is private and may be proprietary or
covered
by legal professional privilege.
If you receive this message in any form and you are not the intended
recipient you must not review, use, disclose or disseminate it.
We would be grateful if you could contact the sender upon receipt and in
any
event you should destroy this message without delay.
Anything contained in this message that is not connected with the
business
of Babcock International BES Division is neither endorsed by nor is the
liability of this company.
Babcock International BES Division
Telephone: +44 (0) 1383 412131
Website: www.babcockbes.co.uk
**********************************************************************
----------------------------------------------------------------------
Subject: RE: Date field
From: "Rodney Majola" <MajolaR@a...>
Date: Tue, 11 Mar 2003 17:43:23 +0200
X-Message-Number: 9
Dim dDate as String
dDate =3D #3/11/2003#
Try putting your literal within quotes eg: dDate =3D "#3/11/2003#"
----------------------------------------------------------------------
Subject: click event affects render process
From: <bcarsto@c...>
Date: Tue, 11 Mar 2003 11:13:22 -0500
X-Message-Number: 10
I want to affect the way my custom controls are rendered based on which
button on my form is clicked.Is there are good way me to propogate
information, a property for example, from my aspx page to all of my
custom
user controls so that they can use this information during their render
phase?
thanks,
bob carsto
----------------------------------------------------------------------
Subject: Re: Nested Repeaters
From: "Christopher Reed" <CReed@m...>
Date: Tue, 11 Mar 2003 10:20:22 -0600
X-Message-Number: 11
It sounds like you have some orphaned records in your OrderItems table.
You will need to remove these or you will need to change your last
parameter in the DataRelation constructor to false.
Hope this helps!
Christopher Reed
Application Analyst
Web Development Coordinator
Information Technology
"...efficient operations and utilization of
technology and communications..."
City of Lubbock
creed@m...
"The oxen are slow, but the earth is patient."
>>> mindwalker@i... 2:47:10 AM 2/22/2003 >>>
Suppose I have the following ASP code, which displays a master-detail
view of two tables:
Set rs1 = db.Execute("SELECT * FROM Orders WHERE X=1 AND
Y=2")
' x=1 and y=2 represent any arbitrary filter criteria, just as an
example
' but the important point is that I'm not retrieving *all* orders
only
' a subset
Do Until rs1.EOF
Response.Write "<u>" &
rs1("OrderID") & "</u><br>"
Set rs2 = db.Execute("SELECT * FROM OrderItems WHERE
OrderID=" & rs1("OrderID")
Do Until rs2.EOF
Response.Write rs2("Item") &
"<br>"
rs2.MoveNext
Loop
Set rs2 = Nothing
Response.Write "<br>"
rs1.MoveNext
Loop
Set rs1 = Nothing
how would I do it in ASP.NET (C# preferably, but VB okay too) using
nested DataRepeaters? I have found a few articles that deal with this
issue, such as
http://www.123aspx.com/redir.aspx?res=29338
and
http://www.123aspx.com/redir.aspx?res=29259
but they both rely on creating a DataRelation between two tables
Orders
and OrderItems, which only seems to work when you retrieve *all*
records
from Orders, not just a subset, because otherwise it will result in an
error "This constraint cannot be enabled as not all values have
corresponding parent values." I know there must be a simple way
to get around this, but I can't figure it out. Here is a snippet of my
code:
DataSet
myDataSet = new DataSet();
SqlDataAdapter
myAdapter = new
SqlDataAdapter();
myAdapter.SelectCommand
= myCommand; // myCommand gets a subset of the data in
myAdapter.Fill(myDataSet,
"Orders"); // the orders table matching certain criteria
myAdapter.SelectCommand
= new SqlCommand("GetOrderItems", myConnection);
myAdapter.Fill(myDataSet,
"OrderItems");
//myDataSet.Tables["OrderItems
// We need to define a relationship between the two tables in the
dataset
DataRelation
myRelation = new DataRelation("OrderID",
myDataSet.Tables["Orders"].Columns["OrderID"],
myDataSet.Tables["OrderItems"].Columns["OrderID"],
true);
myDataSet.Relations.Add(myRelation);
this last line is what causes the error mentioned above. How do I
avoid
this error and still achieve the results I'm looking for?
---
END OF DIGEST