Problem Converting VS2003 Code To VS2005

Aug 14, 2005

Hi:

View 7 Replies


ADVERTISEMENT

Help With Converting Code: VB Code In SQL Server 2000-&&>Visual Studio BI 2005

Jul 27, 2006

Hi all--I'm trying to convert a function which I inherited from a SQL Server 2000 DTS package to something usable in an SSIS package in SQL Server 2005. Given the original code here:
Function Main()
on error resume next
dim cn, i, rs, sSQL
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=sqloledb;Server=<server_name>;Database=<db_name>;User ID=<sysadmin_user>;Password=<password>"
set rs = CreateObject("ADODB.Recordset")
set rs = DTSGlobalVariables("SQLstring").value

for i = 1 to rs.RecordCount
sSQL = rs.Fields(0).value
cn.Execute sSQL, , 128 'adExecuteNoRecords option for faster execution
rs.MoveNext
Next

Main = DTSTaskExecResult_Success

End Function

This code was originally programmed in the SQL Server ActiveX Task type in a DTS package designed to take an open-ended number of SQL statements generated by another task as input, then execute each SQL statement sequentially. Upon this code's success, move on to the next step. (Of course, there was no additional documentation with this code. :-)

Based on other postings, I attempted to push this code into a Visual Studio BI 2005 Script Task with the following change:

public Sub Main()

...

Dts.TaskResult = Dts.Results.Success

End Class

I get the following error when I attempt to compile this:

Error 30209: Option Strict On requires all variable declarations to have an 'As' clause.

I am new to Visual Basic, so I'm on a learning curve here. From what I know of this script:
- The variables here violate the new Option Strict On requirement in VS 2005 to declare what type of object your variable is supposed to use.

- I need to explicitly declare each object, unless I turn off the Option Strict On (which didn't seem recommended, based on what I read).

Given this statement:

dim cn, i, rs, sSQL

I'm looking at "i" as type Integer; rs and sSQL are open-ended arrays, but can't quite figure out how to read the code here:

Set cn = CreateObject("ADODB.Connection")

cn.Open "Provider=sqloledb;Server=<server_name>;Database=<db_name>;User ID=<sysadmin_user>;Password=<password>"

set rs = CreateObject("ADODB.Recordset")

This code seems to create an instance of a COM component, then pass provider information and create the recordset being passed in by the previous task, but am not sure whether this syntax is correct for VS 2005 or what data type declaration to make here. Any ideas/help on how to rewrite this code would be greatly appreciated!

View 7 Replies View Related

Performance Problem With VS2005 Code Style?

May 31, 2006

I run into a wirt asp.net sittuation, when coding my ASP.NET page using the traditional old way like this, it runs very fast:
        Dim thisSQL =" SELECT strAuthorName, strTitle, strContent, lngChapter, tblKiemHiepChapters.strReference FROM tblKiemHiepAuthors A " & _                     " INNER JOIN tblKiemHiepTitles B ON A.ID=lngAuthorID " & _                     " INNER JOIN tblKiemHiepChapters ON B.ID=lngTruyenID " & _                     " AND tblKiemHiepChapters.ID="& e.CommandArgument
        Dim thisConnection As SqlConnection = new SqlConnection(ConfigurationSettings.AppSettings("DNS2"))        Dim thisCommand As SqlCommand = New SqlCommand(thisSQL, thisConnection)        thisConnection.Open()        dim objReader As SqlDataReader = thisCommand.ExecuteReader()                objReader.Read()        if objReader.HasRows then            if (objReader.Item("strTitle") Is DBNull.Value ) Then               thisHeading = Replace(thisHeading, "#HEADING#", "" )
            else               '''''''''''            end if................
but when I used VISUAL STUDIO.NET way of binding datasouce like below: it runs so damn slow. do you guys know what the problem is? if you need to see the complete code please let me know. this happen when my ntext field that contains lots of text (the code post heredoes  not necessary have the same functionality)
<asp:SqlDataSource ID="GetContentByChapterID" runat="server" ConnectionString="<%$ ConnectionStrings:nangmoi_cnn_string %>"SelectCommand="SELECT [lngChapter], [strReference], [strContent] FROM [tblKiemHiepChapters] WHERE (ID = @ChapterID)"><SelectParameters><asp:SessionParameter DefaultValue=0 Name="ChapterID" SessionField="ChapterID" Type="Int32" /></SelectParameters>            </asp:SqlDataSource>

View 1 Replies View Related

VS2005/SSR2005 Report Controlling Field Visibility By Code

Jan 23, 2007

VS2005/SSR2005 Reporting: How can one control an individual report fields visibility (toggle on/off) at run time, based on data values (of the same field or another field) in the report. Without user having to sit there and "Click".

Thanks

Zulu5255

View 6 Replies View Related

Converting Some VBA Code To SQL Function

Sep 6, 2006

Hi,
I'm new to this SQL thing, and I need some help with s stored procedure/function.
First, the scenario:
We are a social service agency, and like all such organizations, we have requirements for perodic reports about our clients. There are lots of them, but if I figure how to do one, I think I can apply the theory to the others.

First, this is some sample VBA code I've tested and which proved satisfactory for the basic task, just for a form. It is passed a date (dteDOP), then adds 3 months, (quarterly report)and loops until it exceeds the current date, thus generating the a due date for the the next report.

'initialize the due date
dteDueDate = dteDOP

'Add quarterly intervals, starting with (DOP + 3 months), until
'you exceed today's date
Do Until dteDueDate > Date
dteDueDate = DateAdd("m", 3, dteDueDate)
Loop
'set a text box to the next due date after today
Me.txtNextQuarDue = dteDueDate

Obviously, this isn't really a function at the moment, but it worked as a test of the logic, with instantly visible results.

This works, but I'd like to do it on the server end, so I can send out notifications. How would this be accomplished as an SQL stored procedure/function? Obviously, for that I'll need to again do a comparison of the current date with the due date for timing concerns, but that should be relatively simple. Also, I know that the '@' symbol is somehow part of variables in SQL Procedures/functions, could you give me a very basic explanation of this, especially the difference between @xxx and @@xxx?

Thanks in advance,
Stephen

-----------------------------------------------
-----------------------------------------------
Gary Getsum: What happened to my mule?
DM: It's dead; It got stung by a giant wasp.
Gary: Can't I heal it?
DM: I'm sorry, I know you were fond of the mule, but it just got attacked by a wasp the size of a Volkswagen!
Gary: So?
DM: Dude, look- you're going to have to carry all your own treasure now... Your mule gives new meaning to the term "Puff Daddy".

View 17 Replies View Related

Converting Access DB Code To Tsql--Help!!!!!

May 3, 2001

We are migrating an access97 database to sql server7.0. there are queries in access which need to be made into tsql queries.And what are the steps to convert access97 to sql7.0 and how do i migrate memo fields to sql7. Is there some method to convert or tool that does that...any help is welcome and thanks in advance.

View 1 Replies View Related

MSSQL 2005EE And VS2003

Apr 2, 2008

i have been trying to get MSSQL 2005EE to work with VS2003 when i go into the server explorer and try to add a new data connection it says that the database is not available, but when i browse the servers it is there and the database i am trying to connect to is there. i do not understand why it can see the sql server but not connect to it. 

View 1 Replies View Related

Connecting To SQL Server Express In VS2003

May 23, 2006

Hi,
Please assist with the following.
 
How do I connect to SQL Server Express in VS2003?  "Do I still use using System.Data.SqlClient;"?
What would the connection string be in the code? The following does not work.
 try   {    string connectionString = "server=localhost;uid=webserver;pwd=wordpass;database=dbMV;";    // create a new SqlConnection object with the appropriate connection string         SqlConnection sqlConn = new SqlConnection(connectionString);       // open the connection      sqlConn.Open();    // do some operations ...    // close the connection    sqlConn.Close();   }   catch(Exception err)   {    Response.Write(err);   }

View 1 Replies View Related

Please Help Compatiblity Between VS2003 And SQL Server 2005

Aug 25, 2006

We have an existing project developed using VS 2003 with SQL server 2000.

Now planning to switch to SQL server 2005.

Are there any compatibility issues between VS 2003 and SQL server 2005, Plus sql server reporting services 2005.

We have been developing this project over a year and don't want to mess it. Now we are at the stage of developing reports and finidng lot of problems with sql server 2000 reporting services.

Thank you very much for the information.

View 1 Replies View Related

Does Anyone Recall How We Used To Get Vs2003 To Allow Rs2000 Design?

Mar 14, 2008

we're all pretty fluent with 2005 products, but must enhance our legacy 2000 RS product, and prefer to use vs2003. Does anyone recall how we used to get vs2003 to allow RS2000 design. We dont believe we saw such an option in installation of vs2003, but since installing the db preceded that, arent sure if we would have been given such an option had vs2003 been installed prior to the 2000 db.

View 1 Replies View Related

Reporting Services VS2003 And MSDE

Aug 24, 2006

Hi,

I'm trying to use reporting services in teh VS2003 but the Option to I create the project does not appear, i've already installed SP3 and no success, any idea ?



Thanks

View 6 Replies View Related

Correct Connection String For Sql Express2005 Using VS2003

Nov 13, 2006

Hi,
I am using VS2003. I have installed .net2.0 so that I can run SQL Express. I am using XP Pro SP2.
My server is called ikitsch. The path to my database is
ikitschsqlexpressDatabasesTest1
I am using windows authentication. For some reason I can't seem to connect to the database. What would be a correct connection string to
connect to this database on my local machine?
Thanks

View 2 Replies View Related

Problem Installing BIDS Alongside With VS2003/VS2008

Apr 10, 2008

I have a problem installing BIDS. On a XP machine with Visual Studio 2003 and Visual Studio 2008 installed, i tried to install SQL Server 2005 DE with SSIS and Client Tools. All works fine, but the devenv.exe where BIDS start menu shortcut points to doesnt exist.
In SQL Server installation dialog, i tried uninstalling BIDS (168 MB disk space will get free'd...) then again installing BIDS (...needs 168 MB disk space...), a lot of harddisk activity, but all the same.
I searched for devenv.exe on drive c:, only two hits: The VS2003 and VS2008 files.
I tried uninstalling VS2008, VS2003, .net3.5, .net3.0, .net2.0 and SS2005, then installing SS2005 with BIDS, again BIDS start menu shortcut points to nowhere. No devenv.exe on drive c:
Now i used system recovery to go back to the point before uninstalling all the stuff, so i can do all my work beside BIDS/SSIS, seaching for a solution...

I thought about installing VS2005 prof., but the license is lost because i upgraded to VS2008.

Note: The VS2008 is installed without installing the SQL Server coming along with VS2008.

Any help?
alberich

View 4 Replies View Related

Stored Procedure Edit Process Not Working In VS2003 C# .Net

Aug 21, 2005

I am trying to follow an exercise for debugging a stored procedure in the .net IDE. I have had success in adding a connection to the application, until I get the point of where I should set a BreakPoint in the stored procedure "Ten Most Expensive Products" which belongs to the Northwind database. When I open Sever Explorer -->Data Connections- ->WI0001.NorthWind.dbo-->Stored Procedures and Right-click the procedure, the context menu does not give me an edit item to select to open this SP in the editor. Nor can I double-click on the stored procedure to open it either.

View 1 Replies View Related

VS2003 - Deploying Reports - No Report Server Was Found At

Oct 19, 2006

Hi all,

We have many domain users who develop/deploy reports using VS2003 to our remote server at https://server/reportserver with no problems at all.

A single workstation on the domain that been used to develop reports cannot deploy though. The message looks fairly simple to diagnose "no report server was found at https://server/reportserver". I have checked dns and the servername resolves no problem. I have manaully edited and added the server to the hosts file also. I have updated and service packed all VS elements (VS2003 7.1.6030).

The server is contactable in all ways on this workstation, all ip/dns settings are the same as other domain workstations.

Can anyone point me in the direction of log files to look at, or if i am missing any basic options in VS. I have checked all deployment settings from other workstations.



Many Thanks!

Alex

View 4 Replies View Related

Access SQL2005 MOBILE Database In A VS2003 Mobile App

Mar 6, 2006



It is possible to access a Sql Server 2005 Mobile database in a VS2003 application (compact framework) ?

Thanks

Robson

View 4 Replies View Related

Sql Ce 2.0 And VS2005

Sep 14, 2007



Hi,

I was going to use Sql compact 2005 with vs2005 and use merge replication with MSDE2000. Unfortunately I found out this isnt possible (only possible if I use SQL Server 2000)

Has I can replicate with MSDE2000 with Sql CE 2.0 the question is:

Can I use sql ce 2.0 with vs2005 and windows CE 5???
Do I use the same System.Data.SqlServerCe assembly?

I hope someone can reply to this.

Thanks,
Luis

View 7 Replies View Related

SP1 And VS2005

Aug 23, 2006

I am running VS2005 Pro edition. I have downloaded, but not installed, SQL Express with Advanced Services SP1. Can I install it over the VS2005 version of SQL Express or do I have to do some install work?

Also, regarding the Books Online July version, must I do a clean install or can I just install it over whatever came with VS2005?

Thanks

View 1 Replies View Related

SQL CE 3.5 For VS2005 - Exe Or Sdk?

Jun 23, 2007

Hi, i'm looking for SQL CE 3.5 for Visual Studio 2005. I am currently using SQL CE 3.1 and wish to use the System.Transactions support which has been included in v3.5.



I know Orcas includes v3.5 but i need to continue using VS2005. Is there an installer or similair so i can develop applications with SQL CE 3.5 with my current development environment? I see there is a new SQL CE sync installer which includes the 3.5 runtime files, however ideally i would like the sdk so i can use the dataset designer. Is it possible?



Thanks

View 8 Replies View Related

How To Show Description In Report Instead Of Code (Desc For Code Is In Master Table)

Mar 28, 2007

Dear Friends,



I am having 2 Tables.

Table 1: AddressBook
Fields --> User Name, Address, CountryCode



Table 2: Country
Fields --> Country Code, Country Name


Step 1 : I have created a Cube with these two tables using SSAS.



Step 2 : I have created a report in SSRS showing Address list.

The Column in the report are User Name, Address, Country Name



But I have no idea, how to convert this Country Code to Country name.

I am generating the report using the Layout tab. ( Data | Layout | Preview ) Report1.rdl [Design]



Anyone help me to solve this issue. Because, in our project most of the transaction tables have Code and Code description in master table. I need to convert all code into corresponding description in all my reports.




Thanks in advance.





Regards
Ramakrishnan
Singapore
28 March 2007

View 4 Replies View Related

What Is Wrong With Ms Vs2005??

Apr 4, 2006

Hello I opened vs2005,new->project->analysis services project ,clicked OK, then dragged a data flow task from the toolbox to the area ,after I double clicked data flow task it gave me error message as shown in the link , what is wrong?


[URL=http://imageshack.us][/URL]

F16 LĂ?GHTĂ?NĂ?NNNG

<edit> To remove the shouting </edit>

View 2 Replies View Related

Backing Up Through VS2005

Nov 19, 2006

Hi, not sure I have should ask this in here or in the VS forums - but here goes anyway!

My vb app is written using VS2005 with an SQL database. I'm now distributing this to users to use with SQL Express.

It's hard enough explaining to them how to attach the database without going into the backup routines etc!

So what I'd like to do is to have a "backup" button in my app, that backsup the database, trancates the log files & then shrinks the files.

Is this possible?

View 14 Replies View Related

Why Do I Keep Losing My Changes (VS2005) ?

Feb 13, 2008

I'm a newbie to both Windows Forms development and SQL Server CE, so please bear with me...

I am developing a vocabulary builder application, and my data keeps reverting to the data set I originally imported. I keep losing the records I've added using the application I'm developing, or from within VS2005. I know about the 'Copy To Output Directory' option in the Solution properties and I set this to 'Do not copy'.

What gives? Not sure what other information you might need, but I suspect it's something really basic...
Thanks!

View 9 Replies View Related

Can't Use SQL Express In VS2005

Mar 4, 2007

When I try to add a new database to App_Data in a VS2005sp1 project I get "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user interface".

I have SQL2005sp2 and SQL Express on the system, both services are running, and an instance of the latter called SQLExpress which I can use through SQL Server Management Studio. sp_configure user instances enabled is set to 1. The SQL Server Instance Name in Options | Database Tools | Data Connections is set to SQLExpress ...

I have no idea how to proceed .. any ideas anyone?

Thanks

John

View 3 Replies View Related

VS2005,ASP.NET Licenses

May 22, 2007

Hi all,
I hope I am on a suitable thread. Sorry if I'm not. I just need to know if I need a license in order to write a commercial application using Visual Studio 2005. And, if so, is this license necessary to me as a developer or to my customer that will purchase the application at the end?
And something more. ASP.NET runs on IIS, which is shipped with Windows Server, correct? So, once my customer purchases Windows, he doesn't anything more in order to run a ASP.NET application (which will finally access the SQL Server DBMS). Is this correct?

Thanks in advance
Lambros

View 1 Replies View Related

Generated Sprocs Of VS2005

Oct 24, 2006

Can someone explain the generated sprocs of VS2005 if one column can be nullableDependentOfSeqID = @Original_DependentOfSeqID OR ((@IsNull_DependentOfSeqID = 1) AND (DependentOfSeqID IS NULL))In VS2003 the generated sprocs would beDependentOfSeqID = @Original_DependentOfSeqID OR ((@Original_DependentOfSeqID IS NULL) AND (DependentOfSeqID IS NULL))Which is the best? 

View 1 Replies View Related

Some Problem In VS2005 With Sql2000

Dec 3, 2006

I am busy with handling connecting to Sql2000,It said some error occured while connecting to SQL2005.
But actually i am using SQL2000.Can somebody give me  a solution ?
By the way,I am a greenhand.

View 4 Replies View Related

SQLDatasource Trouble In Vs2005

Nov 7, 2007

Hi Guys,Have a strange problem at the moment on a page I am working on. Basicly there are 2 SQLDataSource Objects and 2 GridViews(I will call them GV1 and GV2 and DS1 and DS2 (GV = GridView and DS=SQLDatasource if you didn't guess)). Right the problem.... DS2 and GV2 don't display anything yet the SQL being executed is more or less the same.SQL from DS1 is

Code:

View 1 Replies View Related

ASP.NET, VS2005, SSE: Cannot Get Web Application Service

Nov 11, 2005

Hi everyone,
I am attempting to drag the SQLDataSource control to my webpage to initiate a connection to my SQLServer Express instance on the same system. The control will drop correctly, but when I click on the "Configure Data Source" in the SQLDataSource Tasks popup panel, I get the following error message:
Following error occured while getting connection string information from configuration."Cannot get web application service"
It then sends me to the configure data source window where it asks me to choose my data connection. However, there is nothing in the pulldown, and the "New Connection" button does nothing.
I have the SSE data connection defined and visible in the Server Explorer, and there is a connection string defined in the web.config file that points to the server and database I wish to access.
I'm on day 2 of my excursions with VS2005 Pro, so I feel that I'm missing something huge, but otherwise obvious that's different in the configuration of VS2005 as opposed to VS2003, which I have no issues with.
Thanks!Chris

View 1 Replies View Related

VS2005 And C# Windows Application

Nov 8, 2006

I am working on a windows application (C#) that utilizes ODBC to acces paradox tables (works fine thought this would be the problem database) and a WinMobile database(.sdf) in order to sync table records. What I need to do is copy the .sdf file from the winmobile device then access it with this application to check for changed records on the PC and in the mobile database then copy it back to the mobile device via RAPI.

The program compiles fine but when I try to run the application I get this error. Unable to load DLL 'sqlceme30.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) .

I have already copied the System.Data.SqlServerCe.dll to my projects bin folder and then added a reference to it in the projects Reference dialog. These were also copied to the bin folder of the project





sqlceca30.dll


The SQL Server Mobile Client Agent. Required for applications that connect to SQL Server by using replication or remote data access.



sqlcecompact30.dll


Provides the compact database functionality. Required if your application will use compaction.



sqlceer30[language].dll


Contains error strings for SQL Server Mobile-generated errors. Required for all SQL Server Mobile applications.



sqlceme30.dll


Contains code required by the System.Data.SqlServerCe.dll file. Required for all SQL Server Mobile applications.



sqlceoledb30.dll


Provides OLE DB connectivity to SQL Server Mobile databases. Required only if your application uses OLE DB to connect to the SQL Server Mobile database.



sqlceqp30.dll


The SQL Server Mobile Query Processor. Required for all SQL Server Mobile applications.



sqlcese30.dll

I also added using System.Data.SqlCE to the form and the dataset designer.cs

From this code in the dateset.Designer.cs file after the run is started the eroror occurs.

[System.Diagnostics.DebuggerNonUserCodeAttribute()]

private System.Data.SqlServerCe.SqlCeDataAdapter Adapter {

get {

if ((this._adapter == null)) {

this.InitAdapter(); Error on this line....

}

return this._adapter;

Already tried this

http://msdn2.microsoft.com/en-us/library/ms171861.aspx

Is it possible to fix this? Or work around it?



Thanks Jon Stroh

View 3 Replies View Related

Access BIDS From VS2005

Feb 20, 2007

Can SOmeone help me How to get access BIDS from VS2005 . SQL server is installed in different server other than VS 2005 PC

View 1 Replies View Related

Which Should Be Installed First SQL Server2005 Or VS2005

Jan 28, 2007

Hello, Need help about which should be installed first.

Because I am trying to install SQL Server2005 the following message is comming.

Uninstall the previous versions of Visual Studio, .Net framwork or SQL Server..

I have no SQL Server so I unstalled the .net framwork. Now I have only Visual Studio 2005 Professional on my system, but the same message occurs when I try to install SQL Server.....uffff

I have to uninstall Visual Studio too????? And then have to install SQL Server first and then Visual Studio???

View 1 Replies View Related

Vs2005 WSAT Problems. Help!

Aug 25, 2006

hi all,


I created a new sql server 2005 database name wsat_demo in the

(lESSQL1)sql2k5 enterprise server

in the default website properties i added a connection string named WSAT1 to wsat_demo database using aspnet_user account with SA priveledge

i modified the machine.config to use WSAT1 connection string

Then i run the WSAT (website admin tools) to create users.

this error appears. "Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. "



i've tried attaching the database created by the asp.net project located at app_data folder named it App_data1 database

do the same configuration as stated above. Viola! the WSAT connects to it.



After comprehensive investigation, App_data1 database shows that it contains many security objects builtin to it by asp.net 2 application.



QUESTION: How can I have WSAT_demo database to have the same object as App_data1 given the fact that my connection is enjoying SA priviledge?



thanks,



joeydj

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved