Best Way To Deal With XML - Sql 2000)?
Apr 13, 2010
this is my requirement
1 receive an xml string
2 data procress (retrieve data from db ãupdata from db ... )
3 return an result of xml string
this the way I did
1 receive an xml string
2 parse xml by this way
string NO = xml.GetElementByTat("NO")[0].InnerText;
string Name = xml.GetElementByTat("Name")[0].InnerText;
use data to active with Database
ex: select Manager from deparement where EMPNo = 'No' and EMPNAME = 'NAME'
3 return an result xml to the who call webservice
string rtnXml = "<ProjectTeam>"
+"<No>A121</NO>"
+"<Name>Jack</Name>"
+"<Manager>Allen</Manager>"
+"</ProjectTeam>";
like this... but sometimes this way is mass.. do you have other idea to deal with xml ?
View 3 Replies
Similar Messages:
Feb 9, 2010
If one file is used by other process and you are trying to manipulate with it...it gives an error:-
The process cannot access the file 'abc.txt' because it is being used by another process.
In C#, How can i come to know that 'abc.txt' file is used by the process Name "XYZ.exe" (or any other process)?
View 1 Replies
Jan 14, 2011
I have two tables that effectively have a many to many relationship between them. Effectively I want to perform a query that returns results just from Table2. For simplisity table2 has 4 fields: theId, ForeignId, Info, extra
In table2 there can be multiple records with the same value of ForeignId (but each will have a unique theId which is the tables primary key).
I want to perform a:
select top (1) * where ForeignId=x order by extra
which will select 1 record for a given ForeignId
However, I then want to wrap that within an outer query where I have a list of foreignId (ie where ForeignId in ListOfX) but I want to return 1 result record for each value of foreignId. Does that make sense? So the result will be a set of records with one record for each value of foreignId and that record would have 'info' from the top(1) record from the inner query.
View 3 Replies
Mar 8, 2011
ite on dataset model and I used to write sql quires into dataset and call them with in my c# code as usual. and used the datatablein c#code to access the values of each column which corresponds to a sql column in the sql table. after a while I found my website going on too slowso I decided to use linq to sql classes. i can write queries in c# code
[Code]....
View 4 Replies
Jan 26, 2011
I want my Data Access Layer to be built very modular.Therefore I have data retrieval methods that sometimes are called directly from the business layer and sometimes are called by other data retrieval methods to create object dependencies.What is the best way to deal with database connections in the DAL?
a) Create a new connection in every method and dispose it afterwards.Good: Easy to write and to work with.
Bad: Many connections are being opened and closed. (performance?)
b) Pass the connection as an (optional) argument.Good: I could reuse an open connection for multiple commands.Bad: I have to keep track of the ownership of the connection (who has to close it?) and cannot use the very neat "using" statements.c) Something else? (Connection as singleton maybe?)This is the first time I am writing a real DAL so I really could use some help from you experienced folks.EDIT: As it seems to matter, it's an ASP.Net Website Project.
View 5 Replies
Mar 17, 2010
I use the following string format to navigate between webpages:
String.Format(Eval("Hyper") + "?BUSINESSSTREAM={0}&Dealer={1}&LeadID={2}&Companyid={3}&SalesPerson={4}", Eval("BusinessStream"), Eval("Dealer"),Eval("leadId"),Eval("CompanyID"),Eval("SalesPerson"))
However the companyid is a text string and the company may have an "&" in it which I know will truncate the string. I have seen that this can be overcome by using "UrlEncode" [URL] However I cant solve the syntax.
View 10 Replies
Mar 27, 2011
I'm trying to import a few hundreds of data to a SQL server database table from Excell Spreedsheet. In the taable, I created Id as key that is identity. How can I solve identity when I import excel data to the database table.
View 3 Replies
Sep 8, 2010
I recognized that based on a context in which I want to use some parameters, there are at least 4 kinds of encoding that are necessary to avoid corrupted code being executed :
Javascript encoding when constructing a javascript code, e.g.
var a = "what's up ?"
var b = "alert('" + a + "');"
eval(b); // or anything else that executes b as code
[Code]....
View 3 Replies
Mar 8, 2011
I am developing a web application which will deal with online examination. The requirement is:
There can be n-number of sections in an exam and admin users should be able to create questions/answers and add to an exam. The questions should be displayed for a certain amount of time in the browser with meclock and it should move to next question automatically. User should not be allowed to open any other instance of the browser or login from another IP if the exam is in progress.
I am seeking community vote of how would someone design the application to meet all these criterias? What patterns should be used? What components to reduce the development time etc..My technology stack is C#, ASP.NET MVC or ASP.NET with SQL Server.
View 3 Replies
Jul 15, 2010
I have a toolkit tabbed container with an update panel in the bottom of each of the tabbed container's content template. There is also a radio button list an, a text box and a button. The user chooses the search criteria with the radio button list. They then enter the search text in the text box and hit the search button.
The update panel is then going to display the appropriate grid view and results, depending on what radio button was chosen. The logic to check the radio buttons is in the click event of the search button. I currently have one of the grid views and set it's visible property to true in the logic that checks to see which of the radio buttons was selected. My plan so far is to continue adding the other gridviews and doing this the same way with them. This will toggle the correct Grid View on.
I'm wondering if there is a better way of dealing with the Grid Views. There will be one of three to be displayed with in this update panel. They will have different result sets from different tables. Is my approach for turning them off and on with the visible property a bad idea? Should I be doing all of the ODS and grid view stuff programmatically? Is there a better way of doing this?
View 2 Replies
Feb 2, 2010
I have a problem.when i create a new web site and browse it with IE8 ,there is error(Internet Explorer cannot display the webpage) and now i am working with VS2008 and IE8.but i also have an older version of VS(VS2005) on the same computer.when i created a new web page with 2005 ,there is no problem and everything is ok. what is the problem with VS2008??i uninstalled it and reinstalled.but there is same error.i tried VS2008 on the another computer and i had no problem.
View 2 Replies
Nov 30, 2010
I'm working on a pretty basic little site that has content that is populated from a sql database. It's important to know that the data in sql includes some html (bolds, italics, ordered lists,etc). The problem I'm running into, involves the search results. On the search results page, I display the results from a sql query in a gridview. The sql query only returns the first 200 characters of the "Description" field, and then there is a link to click if the user wants to read the full description. The problem I'm running into is when the gridview tries to format the data that has an opening html tag, but no closing html tag (becasue the closing tag is over the 200 character limit.
[Code]....
View 4 Replies
Jun 3, 2010
I have a dictionary in my user's view model used to store user's roles:
[Code]....
In my edit view:
[Code]....
the code above generates:
[Code]....
It seems that when I edited the checkboxes' value and post to server, the UserEditViewModel.Roles is empty.
View 2 Replies
Jun 26, 2010
I have some fields in my db that have a value of "NULL". These are displayed in the Data controls as "NULL". When I try to commit an update the Regex validator is catching this and not allowing the update because it doesn't match the pattern of the regex.
I've thought of one way of solving this, which is to add the value "NULL" to the pattern for the regex. I'm curious though if there is a better way to solve this issue.
View 3 Replies
Feb 2, 2010
I have 3 tables. Blog and Tag have a many to many relationship. BlogTag is a junction table with a quantity column.
**Blog**
BlogID
Title
**Tag**
TagID
Name
**BlogTag**
BlogID
TagID
Quantity
I'm not sure how I handle the quantity column. I'd like it to store how many Blogs have a certain Tag NameHow do I deal with the quantity column when adding a new blog that has tags?
View 1 Replies
Jun 10, 2010
I need to write a sql script which will scan for records in a table (Table1) and thencopy the records found into a second table (Table2). Table2 has the same table structureas Table1Table 1 has a primary Key for the first column named CustIdI thought this would involve A simple sql statement like:
INSERT INTO Table2
FROM Table1
SELECT *
However I just realized that if A record already exists in Table2 and I try to inserta duplicate record into Table2, how should this be handled?Should I instead use an Update statement without a where clause?
View 2 Replies
Dec 31, 2010
I don't like asp.net profile provider store all profile info in one or two row in the database, but I want to use membership/profile API for authentication purpose.Customize membership/role/profile provider requires big big upfront efforts, which may cause more mess later.So how do people deal with that normally?
View 2 Replies
Jul 22, 2010
I am very new on the C# and ASP scene and am after some advice on how to handle a senario. I have a asp website with 10 text boxes. These boxes form the basis of a user completed parameter selection. There is a button that will fire the query. The compliction is that some of the textboxes may be left blank and any combination may be filled in.
The only way i could think to do this is with countless IF statements. The user clicks the button and the process checks out the senarios and runs the corresponding SQL statement. The problem with this is that there are a vast amount of possible senarios depending on whether the user completes one box, all boxes, or a mix of any of them. The SQL query is the same for each senario bar the WHERE statement which changes depending on which text boxes are filled in. Is there another way of doing this or do i really need to write every possible senario out in full?
View 14 Replies
May 20, 2010
I am currently working on an ASP.NET 3.5 and C# web application which deals with users private information like SSN numbers. What are some of the security measures which I need to take from an application development stand point to feel safe?
View 4 Replies
May 27, 2010
Is there built in methods into .net framework to do the following:
Get role GUID from user name/user GUID
Get role name from role GUID
So far I have been sending queries to the asp_roles and asp_users tables to obtain that information and I'm wondering if there is a nicer way of doing this?
I have the following methods that I store in the ASPUtilities class:
getRoleGUID(guid userGuid) { LINQ joins }
getRoleGuid(string userName) { LINQ joins }
getRoleName(guid roleGuid) { LINQ joins }
EDIT:
I have just looked into extending SQLMembershipProvider examples.
Few examples completely override the SQLMembershipProvider, but I think what I'm interested is just adding few extra methods to deal with the roles by using LINQ. Is this feasible?
View 1 Replies
Jan 23, 2011
How to deal with Null values in GridView Container.DataItem
[Code]....
View 1 Replies
Jun 29, 2010
I am using SQL Server 2000 and ASP.NET 3.5.
I want to implement WebParts in my site. But while running my code it shows me an error :
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
View 1 Replies
Jan 24, 2011
Can I do this using SqlClient or do I have to use the ODBC route > ? I get error's in VS but from reading through the other post it appears to be an IDE specific problem.
View 3 Replies
Nov 10, 2010
I have a table in SQL Server 2000 with a text field containing XML that I need to display on a C# ASP.NET 2.0 page. I need to retrieve the XML and then filter out a list of about 80 possible elements (or white list 20 possible elements to keep might be better). I can pull the xml out of the DB and display it on my .aspx page, but I am not sure how to filter out any elements first.
Example XML
<Message>
<MessageNumber>
1234
</MessageNumber>
<MessageType>
Auto Notice
</MessageType>
<UPMessageNumber>
5501
</UPMessageNumber>
<MessageID>
121223
</MessageID>
<ResponseTo>
654321
</ResponseTo>
<DateTime>
2010-11-10 09:35:00
</DateTime>
</Message>
In this case I will need to filter out the UPMessageNumber and MessageID before displaying it on the page.
View 2 Replies
Sep 30, 2010
I've been working on a web app using sql server 2008 on a development machine.... I was previously told the production system was sql server 2005, but now I'm told it is actually sql server 2000... does linq to sql support sql server 2000? I'm using linqdatasource controls to bind to gridviews utilizing it's builtin paging and sorting features..
View 2 Replies