Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Friday, March 30, 2012

Losing double quotes?

Hi,

I have written a little bit of VB.NET code that basically takes three strings, transforms them, and returns a single string to be stored in my table.

I am running into a strange problem, however... for some reason, a number of my processed rows are missing a pair of double quotes (").

The vast majority of the records are formatted properly, and have the double quotes in the expected locations.

The most frustrating thing about it is that I have included the offensive input strings in my Test.sql test script, and when I step through the entire routine, the return value is perfect...

i apologize for being the worst ever at posting questions here, please let me know if i can add anything

Could you please post your code, its hard to uess what is goind wron without seeing your code.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

it is over 500 lines, but i could certainly post it once i get to work...

in the meantime, however, perhaps this might be useful:

I set a breakpoint at my function's final return statement and have observed the return value as follows:

Author of "Some random book." Thoughts and frustrations. Publisher: Me (San Diego). Published in 2007.

This is how I'd like, and expect, the value to appear in my database, but after SELECTING the particular row, I get:

Author of Some random book. Thoughts and frustrations. Publisher: Me (San Diego). Published in 2007.

I doubt this is much more revealing, and will be happy to post my code later, if thought to be any help.

|||

Another thing to add (probably useless):

The problem only occurs during an UPDATE. If I do:

SELECT dbo.EventBuilder([Title], [Author], [Published]) FROM MyTable

I get the correct output.

...getting desperate here

|||

Check your database hold the same result.

I can't able to understand where & what is your problem occurs..

Wednesday, March 28, 2012

loosing connections - closed by server

Hello,
We experience problem with SP2. We have large application based on .NET
combining several MS products and technologies where SQL Server 2005 is used
as a database. We use BizTalk 2006 servers, IIS6 for web applications and
others. All operate on the same SQL Server running in clustered environment.
SQL Server machines run Windows Server 2003 R2 Enterprise x64 Edition SP1,
SQL Server 2005 x64 Standard Edition SP1. Application server machines run
Windows Server 2003 Enterprise (32bit) SP2.
We have installed SP2 for Windows and SP2 for SQL together on staging
cluster and after some time of successful run we have installed it into
production environment too. However in production we unpredictably received
error below raising out of requests from BizTalk components, web applications
and also clients accessing database directly.
A transport-level error has occurred when sending the request to the server.
(provider: TCP Provider, error: 0 - An existing connection was forcibly
closed by the remote host.)
The error was raised in different times from different applications.
Production environment is used by more clients but all together there just
tens of clients. The most critical errors were from BizTalk as it failed to
connect to both BizTalk and applications databases. As the behavior was
business critical we decided to uninstall both SP2 (SQL and Windows) from
production machines. Then the error disappeared but this solution is rather
temporary fix. We havenâ't found much of relevant information and are not able
to even say if the problem is caused by SP2 for system, SP2 for SQL or
combination of both. Anyway we would need SP2 to solve at least another
performance issues with WMI.
Did anyone face the same issue? Any idea for solution?
Thanks
eXavierIt happens to me when I close the connection (via programmatically or from
SSMS' s Query Editor)
--
Ekrem Ã?nsoy
"eXavier" <eXavier@.nospam.nospam> wrote in message
news:91FB542D-9E3E-4D8A-93A2-B756656C9E99@.microsoft.com...
> Hello,
> We experience problem with SP2. We have large application based on .NET
> combining several MS products and technologies where SQL Server 2005 is
> used
> as a database. We use BizTalk 2006 servers, IIS6 for web applications and
> others. All operate on the same SQL Server running in clustered
> environment.
> SQL Server machines run Windows Server 2003 R2 Enterprise x64 Edition SP1,
> SQL Server 2005 x64 Standard Edition SP1. Application server machines run
> Windows Server 2003 Enterprise (32bit) SP2.
> We have installed SP2 for Windows and SP2 for SQL together on staging
> cluster and after some time of successful run we have installed it into
> production environment too. However in production we unpredictably
> received
> error below raising out of requests from BizTalk components, web
> applications
> and also clients accessing database directly.
> A transport-level error has occurred when sending the request to the
> server.
> (provider: TCP Provider, error: 0 - An existing connection was forcibly
> closed by the remote host.)
> The error was raised in different times from different applications.
> Production environment is used by more clients but all together there just
> tens of clients. The most critical errors were from BizTalk as it failed
> to
> connect to both BizTalk and applications databases. As the behavior was
> business critical we decided to uninstall both SP2 (SQL and Windows) from
> production machines. Then the error disappeared but this solution is
> rather
> temporary fix. We havenâ't found much of relevant information and are not
> able
> to even say if the problem is caused by SP2 for system, SP2 for SQL or
> combination of both. Anyway we would need SP2 to solve at least another
> performance issues with WMI.
> Did anyone face the same issue? Any idea for solution?
> Thanks
> eXavier|||Hello,
Based on the symptom, it seems to be related to a known issue if you have
network adapter uses the Broadcom 5708 chipset. This problem occurs because
the TCP/IP offload functionality is enabled on the server. The TCP/IP
offload functionality is enabled by the Windows Server 2003 Scalable
Networking Pack.
To resolve this problem, ask the hardware vendor to determine whether they
have the hardware vendor has the following updates to resolve this problem.
- The latest BIOS update for the server.
- The latest firmware update for the network adapter.
- The latest driver update for the network adapter.
To work around this problem, you may try to disable the TCP Chimney Offload
feature.
To disable the TCP Chimney Offload feature, please follow these steps:
1. Click Start, click Run, type cmd , and then press ENTER .
2. At the command prompt, type the following command, and then press ENTER
Netsh int ip set chimney DISABLED
Note You do not have to restart the server after you run this command.
If the performance of Windows Server 2003 decreases after you disable the
TCP Chimney Offload feature, follow these additional steps:
1. Click Start, click Run, type Regedit , and then click OK.
2. Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
3. Double-click the EnableTCPChimney registry entry.
4. In the Edit DWORD Value dialog box, type 0 in the Value data box, and
then click OK.
5. Double-click the ParametersEnableRSS registry entry.
6. In the Edit DWORD Value dialog box, type 0 in the Value data box, and
then click OK.
7. Double-click the EnableTCPA registry entry.
8. In the Edit DWORD Value dialog box, type 0 in the Value data box, and
then click OK.
9. Restart the server.
If you have any updates or comments, please feel free to let's know. Thank
you.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Peter,
Thanks a lot for your support. Turning off the TCP Chiemney really helped to
solve the problem. Now we have Windows SP2 installed and application runs
well. Thanks!
We also tried to apply the latest bios, firmware and drivers for Broadcom
5708S NICs that are integrated into our blade servers but the offloading bug
is not yet fixed so the only solution at a time is to disable this feature.
Best regards
eXavier
""Peter YangMSFT]"" wrote:
> Hello,
> Based on the symptom, it seems to be related to a known issue if you have
> network adapter uses the Broadcom 5708 chipset. This problem occurs because
> the TCP/IP offload functionality is enabled on the server. The TCP/IP
> offload functionality is enabled by the Windows Server 2003 Scalable
> Networking Pack.
> To resolve this problem, ask the hardware vendor to determine whether they
> have the hardware vendor has the following updates to resolve this problem.
> - The latest BIOS update for the server.
> - The latest firmware update for the network adapter.
> - The latest driver update for the network adapter.
> To work around this problem, you may try to disable the TCP Chimney Offload
> feature.
> To disable the TCP Chimney Offload feature, please follow these steps:
> 1. Click Start, click Run, type cmd , and then press ENTER .
> 2. At the command prompt, type the following command, and then press ENTER
> .
> Netsh int ip set chimney DISABLED
> Note You do not have to restart the server after you run this command.
> If the performance of Windows Server 2003 decreases after you disable the
> TCP Chimney Offload feature, follow these additional steps:
> 1. Click Start, click Run, type Regedit , and then click OK.
> 2. Locate the following registry subkey:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
> 3. Double-click the EnableTCPChimney registry entry.
> 4. In the Edit DWORD Value dialog box, type 0 in the Value data box, and
> then click OK.
> 5. Double-click the ParametersEnableRSS registry entry.
> 6. In the Edit DWORD Value dialog box, type 0 in the Value data box, and
> then click OK.
> 7. Double-click the EnableTCPA registry entry.
> 8. In the Edit DWORD Value dialog box, type 0 in the Value data box, and
> then click OK.
> 9. Restart the server.
> If you have any updates or comments, please feel free to let's know. Thank
> you.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications
> <http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> <http://msdn.microsoft.com/subscriptions/support/default.aspx>.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>

Loops to create a page!

Hi,

Right, I have this problem, and it;s more through lack of understanding vb.net that well more then an actual problem I will out line what I want to do,
basically it all revolves around a page that needs to be built when navigated to so it can be easily updated without anyone having to edit the code.

Get all the table names from a database
Loop through each of the results to build a statement
Nest a 2nd loop to split the returned data from the correct table
Build a listbox for each table returned


This is what I have currently, this works but the problem is, if another course is added, someone will need to manually edit the code on the page to add a new
code to get the new course hence why I want to create a loop that gets all the data so all someone needs to do is put in the all table the new course name. Please note
I cut this down to just show 2 result but there is about 30 odd.

1DBConn =New SqlConnection("Server=SD02;Initial Catalog=WhoGetsWhat;Persist Security Info=True;UID=x;Password=xx")2'Dim DBDataAdapter As SqlDataAdapter3 DBDataAdapter =New SqlDataAdapter("Select AOE,ADC, FROM TBL_Role WHERE Title = @.ddlTitle", DBConn)4 DBDataAdapter.SelectCommand.Parameters.Add("@.ddlTitle", SqlDbType.NVarChar)5 DBDataAdapter.SelectCommand.Parameters("@.ddlTitle").Value = TitleDropDown.SelectedValue6 DBDataAdapter.Fill(DSPageData,"Courses")78'Loop through each record, split at + and place in ListBoxs910 VarDS = DSPageData.Tables("Courses").Rows(0).Item("AOE")11Dim VarArrayAs String() = VarDS.Split("+")12Dim iAs Integer13 For i = 0To VarArray.Length - 11415Dim liAs New ListItem()16 li.Text = VarArray(i).ToString()17 li.Value = VarArray(i).ToString()18Me.txtAOE.Items.Add(li)19Next i2021 VarDS = DSPageData.Tables("Courses").Rows(0).Item("ADC")22 VarArray =Nothing23 VarArray = VarDS.Split("+")24 i =Nothing25 For i = 0To VarArray.Length - 12627Dim liAs New ListItem()28 li.Text = VarArray(i).ToString()29 li.Value = VarArray(i).ToString()30Me.txtADC.Items.Add(li)31Next i
Now here is my pseudo code to what I roughly want to do, hope it makes sense to someone and someone can point me in the correct direction. Please note,
I know the split bit works, so at the minute I am just trying to get the loop to get all my courses

1DBConn =New SqlConnection("Server=SD02;Initial Catalog=WhoGetsWhat;Persist Security Info=True;UID=wgw;PWD=wgwsql;")2 DBSelect.Connection = DBConn3 DBSelect.Connection.Open()4'Get the row number in the database5 DBSelect.CommandText ="SELECT COUNT(*) FROM TBL_All"6 DBResult = DBSelect.ExecuteScalar()7 DBSelect.Connection.Close()8Dim Count = DBResult9'Get all the Tables and Keys in the Database's10 DBDataAdapter =New SqlDataAdapter("SELECT * FROM TBL_All", DBConn)11 DBDataAdapter.Fill(DSPageData,"All")12'declare all loop vars13Dim XAs Integer14 Dim YAs Integer15 Dim iAs Integer16'Loops through all the tables17Dim DSArrayAs String() = DSPageData.Tables("All").Items()18For Y = 0To Count19Dim VarDSAs String() = DSPageData.Tables("All").Rows(0).Item(DSArray(Y))20Dim SplitArrayAs String() = VarDS.Split("+")212223For i = 0To SplitArray.Length - 124Dim LiAs New ListItem()25 Li.Text = SplitArray(i).ToString()26 Li.Value = SplitArray(i).ToString()27Me.txt & DSArray(Y) &.Items.Add(Li)28Next i2930Next Y

I have just realised, in each loop for each course I will need to add the select statement so I think I need to add

DBDataAdapter = New SqlDataAdapter("SELECT " & Dr & "FROM TBL_" & DSArray(Y), DBConn)
DBDataAdapter.Fill(DSPageData, "Courses")

Into it

|||

ok think I am making some head way and I think I have logically what I want.

For every row of column TName in TBL_ALL, assign to var Dim TName
For every row of column PKey in TBL_ALL, assign to var Dim Pkey
For every row create statement "SELECT '" & Pkey & "' FROM '" & TName " "'")

Once I have made the loop that creates all of them select statements, I can run a loop to execute them,
and then a loop to assign the values to listboxes, but first step at a time.

Here is what I have so far, it doesn't work and I know its not right, but maybe someone can see where I am comming from
point my in a better direction. Please also note, the response.write bits are to check when my code i have working is working
but they are not needed

Thanks
Chris

1DBConn =New SqlConnection("Server=SD02;Initial Catalog=WhoGetsWhat;Persist Security Info=True;UID=x;PWD=xx;")2 DBSelect.Connection = DBConn3 DBSelect.Connection.Open()4'Get the row number in the database5 DBSelect.CommandText ="SELECT COUNT(*) FROM TBL_All"6 DBResult = DBSelect.ExecuteScalar()7 DBSelect.Connection.Close()8Dim Count = DBResult9'Get all the Tables and Keys in the Database's10 DBDataAdapter =New SqlDataAdapter("SELECT TName FROM TBL_All", DBConn)11 DBDataAdapter.Fill(DSPageData,"TName")12 DBDataAdapter =New SqlDataAdapter("SELECT PKey FROM TBL_All", DBConn)13 DBDataAdapter.Fill(DSPageData,"PKey")14'declare all loop vars1516Dim DrAs DataRow17Dim DcAs DataColumn18'Loops through all the tables1920 'For Each Dr In DSPageData.Tables("All").Rows21 'For Each Dc In DSPageData.Tables("All").Columns22 'Dim Column As DataColumnCollection = DSPageData.Tables("All").Columns23 'Dim Table As String = (Dr(Dc.ColumnName.ToString))24 'Response.Write(Table)25 'DBConn = New SqlConnection("Server=SD02;Initial Catalog=WhoGetsWhat;UID=wgw;PWD=wgwsql")26 'DBSelect.Connection = DBConn27 'DBSelect.Connection.Open()28 'DBSelect.CommandText = "SELECT '" & Dr(Dc.ColumnName.ToString) & "' FROM ('" & Table & "')"29 'DBSelect.ExecuteNonQuery()30 'Next Dc31 'Next Dr3233Dim Search()As SqlDataAdapter34Dim PKeyAs String35 Dim TNameAs String36 Dim ResultAs String()37For Each DrIn DSPageData.Tables("TName").Rows38For Each DcIn DSPageData.Tables("TName").Columns39'For i = 0 To Count40 PKey = (Dr(Dc.ColumnName.ToString))41 Response.Write(PKey)42 TName = (Dr(Dc.ColumnName.ToString))43 Response.Write(TName)44'DBSelect.CommandText = "SELECT '" & PKey & "' FROM '" & TName & "'"45 'DBResult = DBSelect.ExecuteNonQuery46 'Result(i) = DBResult47 'Next48Next49 Next50 For Each DrIn DSPageData.Tables("PKey").Rows51For Each DcIn DSPageData.Tables("PKey").Columns52'For i = 0 To Count53 PKey = (Dr(Dc.ColumnName.ToString))54 Response.Write(PKey)55 TName = (Dr(Dc.ColumnName.ToString))56 Response.Write(TName)57'DBSelect.CommandText = "SELECT '" & PKey & "' FROM '" & TName & "'"58 'DBResult = DBSelect.ExecuteNonQuery59 'Result(i) = DBResult60 'Next61Next62 Next63 End Sub
|||

maybe I am totally confusing everyone lol? I am so lost :(

Monday, March 26, 2012

Looping through stored procedure inside another stored procedure and displaying the catego

I used to do this with classic asp but I'm not sure how to do it with .net.

Basically I would take a table of Categories, Then I would loop through those. Within each loop I would call another stored procedure to get each item in that Category.

I'll try to explain, Lets say category 2 has a player Reggie Bush and a player Drew Brees, and category 5 has Michael Vick, but the other categories have no items.

Just for an example..

Category Table:

ID Category
1 Saints
2 Falcons
3 Bucaneers
4 Chargers
5 Falcons

Player Table:

ID CategoryID Player News Player Last Updated
1 1 Reggie Bush Poetry in motion 9/21/2006
2 1 Drew Brees What shoulder injury? 9/18/2006
3 5 Michael Vick Break a leg, seriously. 9/20/2006

Basically I would need to display on a page:

Saints
Reggie Bush
Poetry in Motion

Falcons
Michael Vick
Break a leg, seriously.

So that the Drew Brees update doesnt display, only the Reggie Bush one, which is the latest.

I have my stored procedures put together to do this. I just don't know how to loop through and display it on a page. Right now I have two datareaders in the code behind but ideally something like this, I would think the code would go on the page itself, around the html.

try building a query with sub-queries based on a join within the store procedure. test it in the query manager first then before making it a SP

Wednesday, March 21, 2012

loop through all stored procedures in database and modify.

I have a need to loop through all stored procedures within a database and modify the procedure if it meets certain criteria. Using .NET I was able to develop a project to loop through the stored procedures, but that's as far as I got. What I need to do is open the stored procedure, search for a certain text string, and change it. Does anybody have a suggestion as to how I can accomplish this? Thanks.

Karen

create the script of all the sp to a single file (which is possible in EM or SSMS) . then replace the string by FIND & REPLACE method .. then run the script in the database, remember to script the permission too...

Madhu

|||

Hmm.

I have two servers with about 100 databases total. Each database uses a single stored procedure that may be different from the ones in the other databases. I wanted to be able to open the stored procedure, search for the string, then modify the text and save the script in an automated way. And I was wondering if SQLDMO can be used through .NET.

|||

You can get the script of this storedprocedure to a file using SQLCMD. but replacing the text u will have to do by .NET program.

read about SQLCMD

SQLCMD -q"SP_HelpText 'Your SP Name'" -o "Outputfile.sql"

Madhu

|||If you are using SQL Server 2000, all of this is available via SQLDMO. You can get a collection of the databases, loop across all of the databases, get a list of procedures, loop across the procedures and extract the definition, then use the string functions in .NET to find and replace. If this is SQL Server 2005, the same capabilities are available with SMO. The samples that ship with SQL Server pretty much have all of the code that you would need.

Loooping through SELECT values in SQL

Hi,

Environment - VB.NET, ASP.NET, SQL Server 2000.

In a SQL User-Defined Function, I am selecting a row which returns multiple values. I need to construct one single string out of those returned values. To do that, I am using CUROSR.

Now, CURSOR is expensive operation. If there are 1000 users at a time, it will consume lot of resources.

Is there a way, I can construct this String without using CURSORs??

Please advice. Thanks

PankajYou should be able to do something like this to concatenate the columns together:


DECLARE @.myResult VARCHAR(8000)
SET @.myResult = ''
SELECT
@.myResult = @.myResult + myColumn1 + myColumn2 + myColumn3 + myColumn4
FROM
myTable

Terri|||my mistake, the multiple values selected are from the same column (multiple rows)|||That's OK. you can still use the same method:

DECLARE @.myResult VARCHAR(8000)

SET @.myResult = ''

SELECT
@.myResult = @.myResult + myColumn1
FROM
myTable

Terri|||Even though the described SQL works this not a supported T-SQL approach. As per the documentation deom BOL on Select statement :
:: If the SELECT statement returns more than one value, the variable is assigned the last value returned.::

And such an approach is dangerous and can be removed in future builds or service packs. Donot rely on them.

Check out a thread posted by Umachander (MVP, SQL Server) on the same at the public.sqlserver.programmming newsgroup. http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e7dcU%23jiAHA.2088%40tkmsftngp03

There are many other approaches to the same problem. Some of the solutions have been outlined at : http://www.extremeexperts.com/sql/articles/IterateTSQLResult.aspxsql

Friday, March 9, 2012

Looking to add MySQL as a datasource for reports.

I am upgrading my RS server to a windows 2003 server and want to use the
MySQL.dll for .NET.
I know that I am able to add custom data sources to the report designer but
have yet to figure it out.
Can someone point me in the right direction with some very good
documentation?
Thanks
KevinDocumentation on the config files:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_extend_dataproc_8iqq.asp
This should get you started:
* First, you have to make sure the MySQL data provider is installed
correctly, so that the report designer in VS.NET and report server inside
ASP.NET are able to load the dlls of the data provider at runtime. Note:
there could be file system permissions issues which prevent ASP.NET from
accessing the MySQL data provider dlls. You might want to try to copy the
dlls directly into the
report designer and report server installation directories.
* close all VS.NET sessions before modifying rsReportDesigner.config
* backup the existing rsReportDesigner.config and rsReportServer.config
* read the MySQL documentation to find out the type name for the Connection
object which implements IDbConnection. You will need this information when
changing the config files.
* Add these entries to rsReportDesigner.config in the Data section:
<Extension Name="MySQL" Type="***MySql Connection ClassTypeName***,
***AssemblyName***"/>
... and in the Designer section:
<Extension Name="MySQL"
Type="Microsoft.ReportDesigner.Design.GenericQueryDesigner,Microsoft.Reporti
ngServices.Designer"/>
* Stop the ReportServer Windows service
* Add this entry to rsReportServer.config in the Data section:
<Extension Name="MySQL" Type="***MySql Connection ClassTypeName***,
***AssemblyName***"/>
* Restart ReportServer Windows service
* Reset IIS/ASP.NET by running iisreset from the command line
--
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kevin" <k@.r.com> wrote in message
news:OY1LjSz$EHA.2880@.TK2MSFTNGP14.phx.gbl...
> I am upgrading my RS server to a windows 2003 server and want to use the
> MySQL.dll for .NET.
> I know that I am able to add custom data sources to the report designer
but
> have yet to figure it out.
> Can someone point me in the right direction with some very good
> documentation?
> Thanks
> Kevin
>|||Thanks.
It works great.
I am running into a problem with my defined functions. I built a functions
library and have been using it until now so I know it is configured
correctly. I am attempting to convert my reports over but they all use
functions that I have built and I am getting errors returned from the Report
Designer. "Error in SQL Syntax."
Since the MySQL library does work through the report designer. Should the
functions ability also not work as it did with the ODBC driver? I am not
sure of any settings that I might need to check.
Thanks
Kevin
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:%23nvQTnz$EHA.2568@.TK2MSFTNGP11.phx.gbl...
> Documentation on the config files:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_extend_dataproc_8iqq.asp
>
> This should get you started:
> * First, you have to make sure the MySQL data provider is installed
> correctly, so that the report designer in VS.NET and report server inside
> ASP.NET are able to load the dlls of the data provider at runtime. Note:
> there could be file system permissions issues which prevent ASP.NET from
> accessing the MySQL data provider dlls. You might want to try to copy the
> dlls directly into the
> report designer and report server installation directories.
> * close all VS.NET sessions before modifying rsReportDesigner.config
> * backup the existing rsReportDesigner.config and rsReportServer.config
> * read the MySQL documentation to find out the type name for the
> Connection
> object which implements IDbConnection. You will need this information when
> changing the config files.
> * Add these entries to rsReportDesigner.config in the Data section:
> <Extension Name="MySQL" Type="***MySql Connection ClassTypeName***,
> ***AssemblyName***"/>
> ... and in the Designer section:
> <Extension Name="MySQL"
> Type="Microsoft.ReportDesigner.Design.GenericQueryDesigner,Microsoft.Reporti
> ngServices.Designer"/>
> * Stop the ReportServer Windows service
> * Add this entry to rsReportServer.config in the Data section:
> <Extension Name="MySQL" Type="***MySql Connection ClassTypeName***,
> ***AssemblyName***"/>
> * Restart ReportServer Windows service
> * Reset IIS/ASP.NET by running iisreset from the command line
> --
> Robert M. Bruckner
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Kevin" <k@.r.com> wrote in message
> news:OY1LjSz$EHA.2880@.TK2MSFTNGP14.phx.gbl...
>> I am upgrading my RS server to a windows 2003 server and want to use the
>> MySQL.dll for .NET.
>> I know that I am able to add custom data sources to the report designer
> but
>> have yet to figure it out.
>> Can someone point me in the right direction with some very good
>> documentation?
>> Thanks
>> Kevin
>>
>
>

Looking for tool to export data/definitions for later SQL setup.

Any plugable options out there that I can use to export database/table setup
and actual data to xml?
Best yet, would be a .Net class that I could use to control the process for
creating a setup file and then using my own install program to import the
defs/data.
Thanks in Advance,
Donald Adams
"Donald Adams" <BDA_2003@.hotmail.com> wrote in message
news:O0rFG$CIEHA.520@.tk2msftngp13.phx.gbl...
> Any plugable options out there that I can use to export database/table
setup
> and actual data to xml?
> Best yet, would be a .Net class that I could use to control the process
for
> creating a setup file and then using my own install program to import the
> defs/data.
Don't know of any offhand, but you could use SQLXML to export table
definitions from SQL Server (and then you could deserialize them into .Net
classes).
Bryant

Wednesday, March 7, 2012

Looking for SQL-Server ODBC parameters

I've been browsing all over the net, through technet and MSDN as well, all to no avail.

I'm looking for the parameters I can use with SQL-Server drivers of MDAC 2.7 when using dbcconfig in scripts.

E.g. with mysql you can do a line "DSN=Test;Description=Test Odbc DSN;Server=Test_server;user=stars"

Using odbcconf configsysdsn "SQL Server" "DSN=Test DSN;Description=For stars;User=Stars" I get the error "Unable to create a data source name for the "sql-server" driver, drivers configdsn, config driver or configtranslator failed.

If i remove everything but the DSN name, it works, so I must be getting the parameters wrong. But exactly where, I'm not sure..

Thanks for your help!

FlixFirst of all, you should consider to use the native SQL Server OLE DB provider, instead of the ODBC provider. Microsoft declared this provider already obsolete.

Secondly, you reporting two different things: Your MySQL line specifies the ConnectionString as required for the ODBC OLE DB provider. Your SQL Server line, however, does the same, but you are trying to mix that with ODBCConfig.

So, I'm not sure what you want to achieve:

1) specify a DSN-based connection string
2) dynamically define a DSN
3) specify a DSN-less connection string

For 1) and 3) look here (www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForODBCDatabases)|||The old ODBC providor is merely contained to an older system not yet phased out. Based on a SQL-Server 6.5. As all programming ressources on that system has died out, its merely a question of time before an entirely different system is set in place.

My problem (literally) is to keep the system alive as is, and in this case it is to define a DSN through loginscripts using ODBCconfig, as I would otherwise have to churn around with 150 machines creating a host of different DSN's.

In my testing case I am able to give a MySQL DSN more specific arguments using ODBCconfig as opposed to the SQL-Server DSN. Namely which user the DSN should use, and what DB to access... and I can't see the sense in that, as I need to specify user and DB as you would normally do using your ODBC administrating tool.

Hope this clarify's my situation just a whee bit.

Thanks,

Flix|||Okay, if I understand you right, your primary problem isn't to generate a DSN, but to connect via ODBC? Why don't you follow my point 3): use an DSN-less ODBC connection.|||That would require a recoding of this ancient Access 95/97 and SQL 6.5 based system, which is practically like sticking your hand into a wasp-nest. Or do I read the stuff wrong?

Its the database front-end that needs the system DSN's, and in the database there are hordes of linked tables, queries and code all built up against the presence of the system DSN's.

Recoding of the app is pretty much out of the question, as it is destined to be replaced within 6 - 12 months.. so I just need a way to distribute the system DSN to our workstations, in which case I chose odbcconf as it could be called from the login-script.

Cheers, Flix|||Okay, this (http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q171/1/46.ASP&NoWebContent=1) should help you.

Saturday, February 25, 2012

Looking for server and db monitoring scripts

Hello ladies and gentlemen.

I am scouring the net to find SQL2k admin scripts. I am interested in both monitoring of the server as well as the rdbms.

I'm sure this question has been presented many times, but I did not find referenct to it. I'm sorry if this is a very old subject.

I am change rdbms from oracle to sql2k and am having to put in extra effort to change my mind set. Though similar, there are many, many differences.

Any help would be very appreciated.

I will be getting my ms dba certifications soon, and look forward to helping with your dbforums communnity.

Thank youI reccomend a couple good books for monitoring and performance type thigns, I would not reccomend using a bunch of scripts until you know what they are doing.

Two books - Inside SQL Server 2000 by Kalen Delaney and Performance Monitoring with SQL Server 2000 by MSPress.

HTH|||I've been looking for good SQL2k books as well. Thank you for your help.
<br><Br>

Originally posted by rhigdon
I reccomend a couple good books for monitoring and performance type thigns, I would not reccomend using a bunch of scripts until you know what they are doing.

Two books - Inside SQL Server 2000 by Kalen Delaney and Performance Monitoring with SQL Server 2000 by MSPress.

HTH

Monday, February 20, 2012

Looking For Examples Of Stored Procedures in C# or VB.Net.

Hi,

Does anyone have any links to examples of stored procedures written in C# or VB.Net instead of T-Sql. I'd like to see how it looks and works. Thanks! Ken.Hi Ken,

Here are some links for writing stored procedures in .Net compatible language.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sqlclrguidance.asp
http://www.sqlteam.com/item.asp?ItemID=21927

If you have any concerns please revert back, i will send you the sample code.

Best Regards,
Swamy|||The SQL Server Hands On Labs have examples:

http://msdn.microsoft.com/sql/2005/2005labs/default.aspx

See the SQL CLR lab.|||There are several examples available if you installed the samples and documentation. They are located in the C:\Program Files\Microsoft SQL Server\90\Samples\Engine\Programmability\CLR by default.