473,322 Members | 1,690 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,322 software developers and data experts.

binding webcontrol to a C# method that produces string with xml data

Below code:

1. Is only returning one row.. and Im not sure why.
2. I'd like to bind this result to an asp.net web control like
datalist, but's not working. I guess my confusion is that Im trying to
bind as a class object and not an xml file..
3. finally, I was wondering, is there anyway in .net to bind a web
control directly to webservice that is returning an xml file? How, if
you dont know what the service might render, is this what they refer to
as late binding?
public static string Gogetit()
{
string conn = "Data

Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirecto ry|\\xx.mdf;Integrated
Security=True;User Instance=True";
using (SqlConnection connection = new
SqlConnection(conn))
{
connection.Open();
SqlCommand cmd = new SqlCommand("select * from book2 for
xml path", connection);
cmd.CommandType =
CommandType.Text;
XmlReader xr =
cmd.ExecuteXmlReader();
xr.MoveToContent();
return(xr.ReadOuterXml());

Sep 22 '06 #1
0 1081

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

Similar topics

0
by: Wesman | last post by:
Why does the following code not work (displays the correct values in the second textbox). if i chane the OnFocusChange method to the following it will work: private void OnFocusChange(object...
3
by: Richard Urwin | last post by:
I'm using C# and having problems getting the 'Parse' EventHandler of my binding object to be called. Interestingly, the 'Format' method is always called however. A code snippet: (rdDocument is a...
0
by: Lucas, Todd | last post by:
Hello everyone! I'm having a problem with a WebControl that I'm designing for a Menu. I've been at it for about 3 weeks now, and can't seem to get around this problem. So I'm hoping that someone...
3
by: Christian Filzwieser | last post by:
Hy I created a WebControl called StatusBar with a static function public static void SetText(string text) { MyVariable = Text } and on Page Load I set MyVariable to the Label in my WebControl....
6
by: Scott Mueller | last post by:
I have a question about simple binding: (please forgive any syntax errors... I am at home, where I do not have Vb.Net installed, and I rely far too much on Vb's intellisense!) If I have two...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
0
by: Dariusz Tomon | last post by:
Hi I have got the problem with web control displaying flash (swf) object. The problem is connected with the fact that 1-st swf should loads the second one. But it doesn't. That's why I suspects...
1
by: A. Spiehler | last post by:
I'm trying to fill a listBox control with string members from an array of objects. I think using data binding is supposed to be the easiest way to do this. I've never used data binding before and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.