|
I'm working on my first ASP.NET application ever, so this might be an easy problem to solve for you.
I'm collection data from different xml files and want to store them in an DataSet.
The data will be shown with an repeater.
The page will show something like this: (Short version, will be lots of more information)
Miami Engineering
1. General
Doc one
Doc two
2. Feasibilty calculations
Doc three
Doc four
Doc five
When I try to add the data to my DataSet the way I was thinking, I get the error "A DataTable named 'Document' already belongs to this DataSet."
This is when I try to make a DataSet with this structure:
<projects>
<project>
<projectname> Miame Engineering <projectname>
<project>
<part>
<partname> 1. General </partname>
</part>
<document>
<documentname> Doc one </documentname>
</document>
<document>
<documentname> Doc two </documentname>
</document>
<part>
<partname> 2. Feasibilty calculations </partname>
</part>
<document>
<documentname> Doc three </documentname>
</document>
<document>
<documentname> Doc four </documentname>
</document>
<document>
<documentname> Doc five </documentname>
</document>
</projects>
How will I build my DataSet so I can get the output that I want?
modified on Monday, November 17, 2008 5:03 PM
|
|
|
|
|
I am not sure why you're using a dataset, but it doesn't look to me like the data you're using is compatible, unless you specify a maximum number of doctors.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm using a DataSet because I want to be able to add, delete and change data in it.
What do you mean with specifying maximum number of documents?
Haven't seen that option, so how do I do that?
|
|
|
|
|
Miami Engineering
1. General
Doc one
Doc two
2. Feasibilty calculations
Doc three
Doc four
Doc five
This is a tree, with three levels. You would have to create three tables and define the relationship between them, to reproduce this structure. Not sure if .NET is smart enough to do that by itself.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i have a problem. please help.
user control is dynamically added when gridview is selected( invoice number is selected) so far so good. but when a second selection is made
the previous control appears again, naturally. so i want to register usercontrol a new every time grid is selected, how can i do that?
|
|
|
|
|
What do you mean by 'register' ? I think you want to create one control, and then move it if it already exists, b/c viewstate is causing it not to be removed ( or just explicitly remove from all rows but the selected one when you add a new one )
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
:~i'm creating a .csv file on the fly, thus am enclosing all the data within double quotes.
how to put in a newline character is the problem. for eg:-
i tried the following -
"header1","header2","header3"\n"data1","data2","data3"\n"data11","data22","data33"
and
"header1","header2","header3 \n"\r\n "data1","data2","data3 \n"\r\n "data11","data22","data33"
so that the output looks like
header1 header2 header3
data1 data2 data3
data11 data22 data33
thanks a lot for your help
|
|
|
|
|
You need to add the Carriage Return and New Line characters:
Chr(13) & Chr(10)
(in VB you can use the pre-defined ocnstant vbCrLf)
where you want the line breakx to be.
|
|
|
|
|
NEVER use \r\n, use Environment.NewLine
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have a web service in my site, i have session statemanagement to autodetect wheter or not the browser has cookies enabled
<sessionState
mode="SQLServer"
timeout="30"
cookieless="AutoDetect"
</sessionState>
When i try to add the web reference i get an error:
There was an error downloading 'http://localhost/V01/WebService.asmx?op=PedidosNuevos'.
The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/V01/WebService.asmx?op=PedidosNuevos&AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>
In the add webreferece dialog, i can call the web method, i also called it from ie and it works as expected, the only problem is that i cant add it to my project as a web reference
I think it must be because of the redirection to detect if cookies are enabled
How can i add it??
Thanks for any help
Alexei Rodriguez
|
|
|
|
|
I had the same issue; The only way to solve it was to set cookieless="False" in order to add the web reference then set it back to AutoDetect.
If you find a better solution, please let me know!
|
|
|
|
|
Yes, i remember that problem, long time ago.
I had to add to reference as follows:
http://servername/WebService.asmx?WSDL&AspxAutoDetectCookieSupport=1
And i dont remember the reason why, but in my code behind in the load event i have this code:
Me.webservice.Url &= "?AspxAutoDetectCookieSupport=1"
In case you get an error add this part
Alexei Rodriguez
|
|
|
|
|
Hello,
Can somebody give me an example, how can I embed "own" asp.net Controls.
For example I can download a dll here for a special Listbox-control.
What I have to do that I can use this Control?
Thanks
|
|
|
|
|
Add to reference library maybe?
|
|
|
|
|
I added the dll allready as reference to the Project, but what now?
I think i have to create a Tag now and config something?
|
|
|
|
|
iam having datatable with the two columns when a button is click then colum1 data should replace with the column2 data.is it possible
|
|
|
|
|
Sure
foreach (datarow r in datatable.rows)
{
r[0] = r[1];
}
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
I am migrating asp.net 1.1 vertion asp.net 2.0, I am getting an issue in the following code
GroupID = Guid.NewGuid.ToString
dRow.Item("ContentID") = GroupID
GroupID guid value not storing in the drow.Item("ContentID"), which stores an Guid.Empty. while debugging I found the following error
Run-time exception thrown : System.Reflection.AmbiguousMatchException - Overload resolution failed because no Public '=' can be called with these arguments
And I tried with the following code
dRow.Item("ContentID") = new guid(GroupID)
with this code I am not getting run-time error, but its storing only Guid.Empty.
Please explain, how to convert string to guid.
Thanks in advance.
|
|
|
|
|
What is the type of dRow.Item("ContentID")?
Also, you should turn on option strict and option explicit.
Did you try
dRow.Item("ContentID") = Guid.NewGuid()
|
|
|
|
|
Thanks for the reply, dRow.Item("ContentID") is System.Guid type.
I changed this guid type to string, now application is working fine.
But I have question, same code is working in 1.1 version, why its not working 2.0 version?
Thanks
|
|
|
|
|
bhupathi srinu wrote: But I have question, same code is working in 1.1 version, why its not working 2.0 version?
That's just Microsoft making sure its loyal developers have plenty of work to do. MS doesn't want things to just work, that wouldn't be any fun for the programmer now would it?
I didn't get any requirements for the signature
|
|
|
|
|
Hi, i have done one application which tooks input as excel file which contains 2 columns. i took whole excel data to datatable and add two more columsn to datatable and export this data table to csv file by creating file programatically . The application is running sucessfully in my local machine. So i deployed in server. it working fine, when i logged into that server and run from there.
If i run the deployed application from my local machine using
http://192.168.1.110/Myapp/uploadfile.aspx. I am getting the following error.
"The Microsoft Office Access database engine cannot open or write to the file ''. It is already opened exclusively by another user, or you need permission to view and write its data" (IF i took .xlsx file)
"The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data."(IF i took .xls file)
can any one say, why this error is occuring?
I have given all permissons to the folder in server, where i creating the csv file.
G. Satish
|
|
|
|
|
i want to write a database access code in the "gotfocus" or "lostfocus" event of a textbox in a web page.How can it be possible.
Thanx in advance.
|
|
|
|
|
You'll need to use an AJAX[^] callback to the server via the onfocus and onblur events of the textbox.
|
|
|
|
|
thanx for the response.
can you pleasa give me an example.
|
|
|
|