What Are Classic Ado's Recordset Replacements
Mar 15, 2011
I've tried to do my homework on this...
I'm migrating a site from classic asp to asp.net 4.0
Before I rework all the code, I wanted to get clarification that the way i think my database code should be updated is fairly correct. (I'm using SQLClient objects)
First, when old code would use forward only recordsets or access single record/value, I'm fairly sure i'd use SqlCommand and SqlDataReader. That is pretty straightforward.
Now, when my old code navigates a recordset (movePrevious, find, etc.)... I believe the way to go is with SqlDataAdapter and DataTable to retrieve the data and DataView to filter/find/navigate the data.
I'n looking to do a quick migration... i don't want to get too bogged down in the new entity framework... so - just trying to stick with similar objects/logic.
I know this is one of those questions that doesn't really have a right/wrong answer... and I think that is part of my problem in finding an answer - there are so many.
View 2 Replies
Similar Messages:
Nov 10, 2010
I am trying create a Regex-based replacement for an article to automatically convert embedded references (many of them) in posts into the appropriate link and title format.
For example, given this:
I have already blogged about this topic ((MY TOPIC ID: "2324" "a number of times")) before. And I have also covered ((MY TOPIC ID: "777" "similar topics")) in the past.
... I want to get this:
I have already blogged about this topic <a href='/post/2324'>a number of times</a> before. And I have also covered <a href='/post/777'>similar topics</a> in the past.
I currently have this:
/* Does not work */
public static string ReplaceArticleTextWithProductLinks(string input)
{
string pattern = "\(\(MY TOPIC ID: \".*?\" \".*?\"\)\)";
string replacement = "<a href='/post/$1'>$2</a>";
return Regex.Replace(input, pattern, replacement);
}
But it seems to return lines that contain <a href='/post/'></a> without appending matches instead of $1 and $2.
Question: What is the easiest way to do convert the string #1 above to string #2 above?
View 1 Replies
Mar 31, 2011
using asp.net 4 we do a lot of Word merges at work. rather than using the complicated conditional statements of Word i want to embed my own syntax. something like:
Dear Mr. { select lastname from users where userid = 7 },
Your invoice for this quarter is: ${ select amount from invoices where userid = 7 }.......
ideally, i'd like this to get turned into: string.Format("Dear Mr. {0}, Your invoice for this quarter is: ${1}", sqlEval[0], sqlEval[1]);
View 4 Replies
Feb 3, 2010
I have created an asp.net web page that allows one to query a SQL Database and returns a recordset in a bound gridview. My question is how can I provide a means for the authorized webpage user to print the recordset out, in like a cvs text file? I need to be able to allow her to choose her printer, like in a regular print dialog box, and then to print the whole recordset, not just the page she's on.
View 3 Replies
Dec 21, 2010
It may not suitable forum to post this.I'm a ASP.NET developer, I'm just doing a small corrections in a site developed in classic asp.i want to know how to idendify whether the Recordset has records or not? like in asp.net we use dt.Rows.Count In Classic ASP?
View 9 Replies
Dec 12, 2010
I gather from what I have read that the VB6 adodb.recordset is not the best way to work with database tables in VB NET
I have a program created in VB6 that I would like to upgrade or re-write in VB NET
What I am finding difficult to understand or find is the answer to what I use in place of the VB6 adodb.recordset
I have found the code to make DATASET and OleDbDataAdapter and can open an Access or SQL table
But what I do not find or follow is how you move through the rows of a table
With the adodb.recordset you could Do While Not EOF and MoveNext
What is the equivalent to that in VB NET without using adodb.recordset?
View 4 Replies
Jun 22, 2010
I'm using a DataReader to display informations stored in a table. I created Two button to go to next record and to go back. In VB6 I used this code :
While Not Recordset1.EOF
Recordset1.MoveNext
End While
In ASP.NET I didn't find a way to do like it, because DataReader hasn't the EOF property.
EDIT :
While Not Recordset1.BOF
Recordset1.MovePrevious
End While
How can I convert this last code (VB6) to ASP.NET?
View 2 Replies
Feb 11, 2011
based on the code below how can I tell if the recordset returned is empty and if the grid is emptyIf data is empty how can I tell data.Count(); and data.RecordCount(); generate errorsHow can I tell if the grid is empty, has no rows or if the rowcount = 0
var db = Database.Open("StarterSite");
var sqlQ = "SELECT * FROM table1 ORDER BY Name";
var data = db.Query(sqlQ);
var grid1 = new webgrid(data);
grid1.gethtml();
View 2 Replies
Aug 1, 2010
new to asp.net and mvc, sorry if the question sounds dumb. I currently have a model (a Linq type) that get data from a table. I use this model to do a Linq qery and display all records in a listing table.I would like to do exactly the same but using a SQL command/query rather than Linq as I'm much more confortable with "standart" SQL. I now need to join tables and return specific columns with custom names as some columns have the same name in the join of my query.If you have another idea (create a stored procedure to be in control of the SQL and then use Linq to call it, for example), I'm open to sugestions.In the view, I loop all records doing: foreach (var item in Model) {}Not sure if this could be important o note
View 2 Replies
Mar 3, 2011
I have run into the issue on DataSet.WriteXml method. Apparently, if any row in a column in the DataSet has a null value, the entire column/rows will not write out in the xml file using the method DataSet.WriteXml. So, as terrible as that bug is, I need to send the data another way. Does anyone have any thoughts?
View 4 Replies
May 19, 2010
Here's a stored procedure I created that uses another stored procedure inside it to return a value:
[Code]....
Note the 'exec dirinfo.dbo.d_searchempbyname @TicketSubName' part. That stored procedure will return a single record. What I need is to get a single column from that recordset (in this case, the email address of the employee), and store that value in a variable.
View 3 Replies
Feb 26, 2010
Hi. On my webpage, I have a listview that has a field called BookId. I also have a Detailsview with an ID field. When I add a new record on the listview, I would like to populate the BookID from the Id on my detailsview (there is a one to many relationship between the 2 ids).
View 1 Replies
Oct 12, 2010
I am new to ASP.Net. I am working on an ASP application in which I need to use an existing C# class (.cs) to get a return and pass to my ASP code. I know it may be impossible to call C# class directly from classic ASP.
View 11 Replies
Nov 23, 2010
Just two many pages to re-write. A Microsoft consultant informed us it would cost about $750,000 to rewrite all of our pages. The school district's budget is only $67,500 so this is out of the question. Therefore I am going to have to stick to asp Classic.
View 1 Replies
Jun 15, 2010
I am asking my self many times before start writing a new app or data access library , should I use LINQ to SQL or classic ADO.net , I have used both and the development time I spend on building an app with LINQ to SQL is like the 1/3 compared to ADO.net.
The only think I like using LINQ to SQL is that I don't have to design the domain objects LINQ does that for me and saves me from spend my time on boring things :P But is LINQ to SQL suitable for large scale projects, is there an overhead that we can avoid when using ADO.net ?
View 7 Replies
Jun 23, 2010
I currently work for a company that uses a combination of ASP.NET Webforms and legacy ASP pages for web development. This works fairly well for their current projects but I would like to convince / suggest to them to switch over to ASP.NET MVC since most of their codebase consists of wiring form elements to stored procedure parameters. Just using an ORM is also a possibility but I think it would be a good idea to use this opportunity to switch to an MVC framework.
However, I'm not sure how easy it will be to deploy an ASP.NET MVC app along side ASP.NET and Classic ASP code while the codebase is updated. First, I would like to ask if this is even possible. I've seen threads about running ASP.NET with Classic ASP and ASP.NET MVC with Webforms but not all three in the same application. They currently have Webforms and Classic ASP working together so the pitfalls associated with that are already solved.
View 2 Replies
Dec 4, 2010
some automated tools to help in migrating classic ASP to ASP.NET I tried to install "ASP to ASP.NET 1.x Migration Assistant" from the link below but it encountered a problem during installation. Has anyone used it? Any other better tools? I know everything cannot be automated but I would imagine there are some tools out there. [URL]
View 6 Replies
Jun 1, 2010
We are in design phase of a project whose goal is replatforming an ASP classic application to ASP.Net 4.0. The system needs to be entirely web based. There are several new requirements for the new system that make this a challenging project:
The system needs to be database independent. It must, at version 1.0, support MS SQL Server, Oracle, MySQL, Postgres and DB2. The system must be able to allow easy reporting from the database by third party reporting packages. The system must allow an administrative end user to create their own tables in the database through the web based interface. The system must allow an administrative end user to design/configure a user interface (web based) where they can select tables and fields in the system (either our system's core tables or their own custom tables created in #3) The system must allow an administrative end user to create and maintain relationships between these custom created tables, and also between these tables and our system's core tables. The system must allow an administrative end user to create business rules that will enforce validation, show/hide UI elements, block certain actions based on the identity of specific users, specific user groups or privileges.
Essentially it's a system that has some core ticket tracking functionality, but allows the end user to extend the interface, business rules and the database. Is this possible to build in a .Net, Web based environment? If so, what do you think the level of effort would be to get this done? We are currently a 6 person shop, with 2.5 full time developers.
View 5 Replies
Mar 28, 2011
I am new to ASP and ASP.net.I have just started working on a legacy ASP classic project and been given a sample that makes a remote call in ASP.net.Is it possible to call the ASP.net page from ASP?Are you they compatible.My impression so far is that they aren't compatible, but perhaps. I'm wrong.I mean the .net project could be called with parameters and kept seperate I guess?Does anyone have any experience with similar problems or have any tips they can share?
View 2 Replies
Jan 25, 2011
We have a big classic ASP website, and we want to start writing new code in .net, (the website is way to big to rewrite 100% at this stage).
The old website uses session variables, will these still be accessible in the .net pages, and if not (which I suspect) is there anything we can do to make them accessible?
The new section is detachable, that is it is pretty much independent from the rest of the site so should be fine to write in .NET, it's just sessions which are important to us. Do we need another login page?
How bad practise would it be to ajax a local .net page which sets session info when they login to the old site? Can we copy session data this way?
View 1 Replies
Feb 7, 2010
I know S#arp architecture is built for ASP.NET MVC. But I'm wondering if it can be used in classic ASP.NET (WebForms) or even desktop applications like WinForms or WPF.
View 3 Replies
Jul 30, 2010
how I can include .inc file from VB classic ASP in C# aspx page?
I try do it with:
<!-- #include file="menu.inc" -->
But I receive error about syntax in menu.inc "Compiler Error Message: CS1003: Syntax error, '(' expected" - "Line 3: if Len(Session("GUID")) < 1 Then":
<%
if Len(Session("GUID")) < 1 Then
Response.Redirect "default.asp"
End If
%>
View 1 Replies
Jan 24, 2011
We have a site and a logged in section of the site that all was written in classic asp. We are starting to convert the site pages to asp.net 3.5. We are starting with the easiest pages (text mainly) first then we will rewrite the web application part of the site.
My question is - Is it possible to run the new asp.net 3.5 pages with classic asp pages? Or will we need to rewrite everything before deploying?
View 1 Replies
Jun 9, 2010
For some reason, the response.redirect seems to be failing and it is maxing out the cpu on my server and just doesn't do anything. The .net code uploads the file fine, but does not redirect to the asp page to do the processing. I know this is absolute rubbish why would you have .net code redirecting to classic asp, it is a legacy app. I have tried putting false or true etc. at the end of the redirect as I have read other people have had issues with this. it runs locally on my machine but won't run on my server! I am getting the following error when I debugged remotely.
View 6 Replies
Feb 2, 2011
In my asp.net file I have the following form with data
[Code]....
So on my login.asp why I see frédéric instead of frédéric How do I encode it?
View 1 Replies