ADO.NET :: Performing Several Operations In One Table?
Feb 15, 2011
I have a table in a DB in which I need to perform the following operations:
1. Order the table using index A.
2. Traverse the table and do some calculations for every row.
3. Order the table using index B.
4. Traverse the table and do some calculations for every row.
5. Order the table using index C.
6. Traverse the table and do some calculations for every row.
As you can see, what I need is to process such a table several times depending upon a different index for every process. If I use a DataReader I can only traverse it one way and one time, I cannot apply another index and start from the beginning once again. What strategy should I use to achieve my goal? Is a DataTable a good choice?
View 2 Replies
Similar Messages:
May 11, 2010
when i want insert a record i see an error like this Can't perform Create, Update, or Delete operations on 'Table(MainMenuLink)' because it has no primary key. with this codes:
MyLinqDataClassesDataContext db = new MyLinqDataClassesDataContext();
MainMenuLink li = new MainMenuLink { Link = "www.tprogrammer.com", LinkSubject = "subject" };
db.MainMenuLinks.InsertOnSubmit(li); [code]....
View 2 Replies
Aug 4, 2010
I've got a routine that's supposed to be capturing data from an XML to a DataTable (which works fine), and then using that data to insert into MS SQL. I have no problems with the Inserting of records (via a different routine) but am struggling to update existing records - I'm not even getting any errors, and I can verify that the data is being assigned to the parameters.
Here's what I've got.
Shared Sub Sold(ByVal FullPath As String)
Dim SQLSold As String
Dim SC As New SqlConnection(CS)
SQLSold = "Update Properties SET Status = @Status, Price = @Price WHERE UniqueID = @UniqueID"
Dim DT As New DataTable
[Code]....
View 12 Replies
Apr 21, 2010
I made a GridView application and adds a Delete icon into the GridView. When i compiled a code, it shows the GridView properly, but as i clicked on the Delete icon, it shows the following error: Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified.
View 3 Replies
Apr 22, 2010
I have a listview in a User Control. It uses FreeTextBox for one of the fields.
I do not want to utilize
[Code]....
Here is my code from the listview edit item template:
[Code]....
What else can I do to not have the validate request set to false and still get beyond the error?
View 4 Replies
May 14, 2010
i am developing webservices.In that i want to maintain state information so that all WebMethods could be access only after Login.I have tried but getting problem.I am attaching my code.Any other alternative will also be welcomed.
[
WebService(Namespace = "http://amSubfah.org/")]
[
[code]...
View 1 Replies
Jul 6, 2010
I would like to know how to avoid the same operation from being performed twice after some action has been taken on the gridview.
i.e. on clicking a button in gridview, operations in RowCommand get executed. Then on doing a page refresh, the same thing gets done again.
How can we avoid this?
View 1 Replies
Jul 13, 2010
I have created a utility method that contains some try/catches in it. In those try/catches I need to redirect the customer using an HttpResponse redirect. I can't seem to figure out how to do this outside a web project. This utility class is referenced from my ASP.NET web project and so I'm just abstracting out some of the code into this utility class so I no longer have the request object.
I know I can use HttpWebRequest object for a lot of web related request tasks outside a web project, but could not seem to get any redirect method there to use after putting in a using System.Net; in my utility class.
View 4 Replies
Jan 19, 2010
We need the ability to send out automatic emails when certain dates occur or when some business conditions are met. We are setting up this system to work with an existing ASP.NET website. I've had a chat with one of the other devs here and had a discussion of some of the issues.Things to note:All the information we need is already modelled in the ASP.NET websiteThere is some business-logic that is required for the email generation which is also in the website alreadyWe decided that the ideal solution was to have a separate executable that is scheduled to run overnight and do the processing and emailing. This solution has 2 main problems:If the website was updated (business logic or model) but the executable was accidentally missed then the executable could stop sending emails, or worse, be sending them based on outdated logic.We are hoping to use something like this to use UserControls to template the emails, which I don't believe is possible outside of an ASP.NET websiteThe first problem could have been avoided with build and deployment scripts (which we're looking into at the moment anyway), but I don't think we can get around the second problem.So the solution we decided on is to have an ASP.NET page that is called regularly by SSIS and to have that do a set amount of processing (say 30 seconds) and then return. I know an ASP.NET page is not the ideal place to be doing this kind of processing but this seems to best meet our requirements. We considered spawning a new thread (not from the worker pool) to do the processing but decided that if we did that we couldn't use the page returned to signify a success or failure. By processing within the page's life-cycle we can use the page content to give an indication of how the processing went.So the question is:re there
View 6 Replies
Mar 17, 2010
I'm trying to create a simple portfolio page. I have a list of thumbs and an image. When you click on a thumb, the image will change.
When a thumbnail is clicked, I'd like to have the image fade out, wait until the image is loaded, then fade back in. The problem I have right now is that some of the images are pretty big, so it fades out, then fades back in immediately, sometimes while the image is still loading.
I'd like to avoid using setTimeout, since sometimes an image will load faster or slower than the time I set.
Here's my code:
$(function() {
$('img#image').attr("src", $('ul#thumbs li:first img').attr("src"));
$('ul#thumbs li img').click(function() {
$('img#image').fadeOut(700);
[Code].....
View 3 Replies
Jan 3, 2011
Is there any way to perform traditional web based Upload SaveAs option with consoleapplication. I just want to call the saveAs option by passing the filename as argument need to be saved to the location.
View 1 Replies
Mar 11, 2010
I'm using telerik radgrid with some record rows , after updates one row from grid,where dispaly only that row.After click refresh button,all the records are view.
View 2 Replies
Jul 29, 2010
I'm learning about storing state in 'TempData' when performing the PRG (Post-Redirect-Get) pattern. It says TempData stores session state on the server. I'm wondering if this is safe or unsafe in a load-balanced server farm?
Are there precautions to be taken with TempData? Or can we happily program against it with abandon. Just wanting to avoid the frights we all got with the Session back in the day with ASP.NET of old.
View 1 Replies
Nov 9, 2010
I am trying to set up a POST from one aspx file to another progromatically. Inside the POST is a String of XML data which i have properly added to Server.HtmlEncode(). For some reason, when I grab it in my logs on the other page, it is showing with 3 question marks. I at first thought it was logging text i left somewhere, but have narrowed it down to a Encoding error of some sort because when i change the encoding it changes the character, and when I just put some text in there, i see it on the other side fine. i have tried UTF 8,UTF32,Unicode,ASCII... Can't seem to find the right combination. Can't find the UTF-16
when I use the Encoding object
Below is my Code:
[Code]....My Sending Debug log has the Extension xml coming out in HTML format correctly before POST. Below is just a piece of it[Code]....
And then on the other side log I get the below
Extensions =??
View 1 Replies
Dec 10, 2010
Grouping Textbox controls together and performing javascript validation
View 2 Replies
May 3, 2010
I have the following setup:
[URL]
[URL]
Each virtual directory is configured on IIS6.0 as an application with own AppPool.
When redirecting authenticated user from dir1 to dir2 using response.redirect I lose authentication information for the user and the user is being redirected to the login page. This issue was not coming up with each app (dir1 and dir2) were configured under subdomain, ex: [URL]
I have resolved the issue by adding a machine key to the machine.config file.
View 2 Replies
Jun 23, 2010
I have set executionTimeout in web.config to 3600 (which I found out that the scripttimeout will follow this value), and in the production server, I have set debug=false, session time out = 20 min. sql command time out = 1200 seconds
However, when the application is performing heavy sql task that exceed 90seconds, I got the 'Page Could Not be Displayed' error.
When I change debug=true, the application works fine. The application also works fine when I turn off the 'Show HTTP friendly message'.
View 4 Replies
Aug 30, 2010
i am using jquery and passing my data to webmethod,but asp.net validation are not performing their desired action on button click,if i enter wrong data,they still post the data,how i m going to stop that???
View 4 Replies
Sep 7, 2010
I want to use my functions in DAL asynchronously by executing them in a separate thread. The issue in all this is suppose I have a function DAL.GetProducts() which returns a DataTable. If I execute this function in a separate thread, when it is completed how do I get the returned DataTable from this thread and bind it to my UI?
View 3 Replies
Feb 4, 2010
i make a grid view for performing crud operation. In last coloum item template of grid view, i write code as below..
[Code].....
View 1 Replies
Sep 22, 2010
How can we log user operations for a asp.net application. Further what is the approach for saving the log data ?
View 3 Replies
Jan 7, 2010
I'm reading the stream from a FileUpload control, reading in chunks of n bytes and writing the array in a loop until I reach the stream's end.Now the reason I do this is because I need to check several things while the upload is still going on (rather than doing a Save(); which does the whole thing in one go). Here's the problem: when doing this from the local machine, I can see the file just fine as it's uploading and its size increases (had to add a Sleep(); clause in the loop to actually get to see the file being written).
However, when I upload the file from a remote machine, I don't get to see it until the the file has completed uploading. Also, I've added another call to write the progress to a text file as the progress is going on, and I get the same thing. Local: the file updates as the upload goes on, remote: the token file only appears after the upload's done (which is somewhat useless since I need it while the upload's still happening).
Is there some sort of security setting in (or ASP.net) that maybe saves files in a temporary location for remote machines as opposed to the local machine and then moves them to the specified destination? I would liken this with ASP.net displaying error messages when browsing from the local machine (even on the public hostname) as opposed to the generic compilation error page/generic exception page that is shown when browsing from a remote machine (and customErrors are not off)
View 2 Replies
Feb 25, 2010
I recently purchased a new domain for the sole purpose of hosting all the static content on a separate server and delegate CPU intensive operation like thumbnail creation on a different pool. Now I would like to do some operations on images uploaded to that remote server : creating thumbnails or updating the image if we need to. Should I download the images to my server, modify them there and then upload them back to the remote server or should I try to create web-services to manipulate the images?One of my solution was to provide an interface to upload and manipulate the images in the new domain, by leaving the old domain when it comes time to work on images, but I find it kind of awkward.I would like to keep the new domain cookie free. How would that affect my ability to restrict any random user to use the web-services if I decide to go that way?
View 1 Replies
Jan 19, 2010
I find myself needing to preform the same actions on both HtmlControls and WebControls. I am a firm believer in DRY and find the fact that there is only the Control class to use if I want to consolidate the functions on both types. The problem that I have with using Control is that there certain properties that both HtmlControl and WebControl expose that Control does not. In the current case, the Attributes property is the problem. how to avoid the duplication of code in this type of instance?
View 2 Replies
Dec 22, 2010
I have a page which is accessible only from Monday to Friday. If i try to open it on Saturday or Sunday it shouldn't.I have a column in my DB naming WorkingDays and iam storing Bitwise value
Monday=1,Tuesday=2,Wednesday=4,Thursday=8....
So the value in my DB is 31 which is equal to Monday to Friday.If i open the page on saturday how should i check?
How should i convert todays day to bitwise value and how should i compare with the DB value.
View 12 Replies