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

Thursday, March 29, 2012

Data files and filegroups

Hi all,

Can anyone tell me direct me to any resources on the net on SQL Server data files and filegroups. I want to manage historic data (which is about 500GB and growing) for reporting purposes. I was thinking about creating a data warehouse. But first I want to build a strong file structure for database objects like tables, views, indexes etc.

I got basic information about files and filegroups from books online but I need more juice before I start actual work.

All comments are appreciated and thank you in advance.

Yogi

Hi Yogi...is this SQL 2000 or 2005? (could be some big differences in how you want to handle things between the two...).

If 2005, respond and say so...here are some articles for 2000:

For an overview on the physical architecture and general usage, these are good:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_da2_9sab.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_02_6epf.asp

For data placement and performance (see sub-topics also):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/optimsql/odp_tun_1_2upf.asp

For moving data:

http://www.sqljunkies.com/How%20To/B9F7F302-964A-4825-9246-6143A8681900.scuk

Performance tips:

http://www.sql-server-performance.com/filegroups.asp

Also, note that there are some special considerations sometimes for backups, administration, etc. for filegroups. Go to Books Online, move to the index tab, and type 'filegroups' in the textbox...this should bring you to the top-level filegroups item which has 10-15 sub-items...look over those too, great information there.

HTH

|||

Hey,

Thank you very much but I have gone through these links already most of them are similary to BOL.
I am still collecting information comments are welcome!

sql

Sunday, March 25, 2012

Data encyption using symmetric keys outside SQL Server

Hello. I have a problem that spans VB.net, SQL Server and SSIS but is rooted in the need to encrypt column data in SQL Server.

I would like to encrypt data that I am bringing into SQL Server in the Data transformation script component of an SSIS package. I have achieved this but I can't decrypt the data because the keys don't match. I would like to use symmetric key encryption but I don't see how to get the symmetric key that I created in SQL Server available to the VB.net script component in SSIS.

Please advise me if my approach is correct and what steps I need to take.

Importing or exporting key material for SYMMETRIC KEYs is not supported in SQL Server 2005. SYMMETRIC KEY material is always encrypted in the database and we don’t have any access point where we display such material in an unprotected form for security reasons, because of this SYMMETRIC KEYS as well as ciphertext created by EncryptByKey are only meant to be consumed by SQL Server.

-Raul Garcia

SDE/T

SQL Server Engine

|||Thank you for the response. I suspected as much for the very reasons you mentioned.
I did some work on asymetric keys but wasn't successful. Can you tell me the correct strategy to expose the public key so I can use it to encrypt within the SSIS package.|||

Here is a link that should be useful. In this link the author was also using ASYMMETRIC KEYS in SQL Server and VB .Net:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=384472&SiteID=1

I hope this information will be useful,but let us know if there is anything else we can do to help.

-Raul Garcia

SDE/T

SQL Server Engine

data encryption in SQL Server 2005 - protect from SQL Admnis

I need to store some sensitive data in SQL 2005.
Stored procedures will encrypt & decrypt the data. The client app is written
in .NEt using a specific user (belonging to a specific - custom role).
However, inspite of the above, the local Admin can always view the code in
the decription stored procedure & decrypt & hence view the data.
How can i prevent the administrator (everyone) except for the application
from being able to view the data.
Is it possible to remove access to a stored procedure even from an
administrator & give access to a special user (the password of which is know
only by the application)'
Then again the owner of the above role will have access to the stored
procedures!!This is a good backgrounder on the topic:
http://blogs.msdn.com/lcris/archive/2006/11/30/who-needs-encryption.aspx
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Don" <Don@.discussions.microsoft.com> wrote in message
news:A25E337B-AA5C-456B-95AD-E4D2F36D4B0A@.microsoft.com...
>I need to store some sensitive data in SQL 2005.
> Stored procedures will encrypt & decrypt the data. The client app is written
> in .NEt using a specific user (belonging to a specific - custom role).
> However, inspite of the above, the local Admin can always view the code in
> the decription stored procedure & decrypt & hence view the data.
> How can i prevent the administrator (everyone) except for the application
> from being able to view the data.
> Is it possible to remove access to a stored procedure even from an
> administrator & give access to a special user (the password of which is know
> only by the application)'
> Then again the owner of the above role will have access to the stored
> procedures!!

data encryption in SQL Server 2005 - protect from SQL Admnis

I need to store some sensitive data in SQL 2005.
Stored procedures will encrypt & decrypt the data. The client app is written
in .NEt using a specific user (belonging to a specific - custom role).
However, inspite of the above, the local Admin can always view the code in
the decription stored procedure & decrypt & hence view the data.
How can i prevent the administrator (everyone) except for the application
from being able to view the data.
Is it possible to remove access to a stored procedure even from an
administrator & give access to a special user (the password of which is know
only by the application)'
Then again the owner of the above role will have access to the stored
procedures!!This is a good backgrounder on the topic:
http://blogs.msdn.com/lcris/archive...encryption.aspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Don" <Don@.discussions.microsoft.com> wrote in message
news:A25E337B-AA5C-456B-95AD-E4D2F36D4B0A@.microsoft.com...
>I need to store some sensitive data in SQL 2005.
> Stored procedures will encrypt & decrypt the data. The client app is writt
en
> in .NEt using a specific user (belonging to a specific - custom role).
> However, inspite of the above, the local Admin can always view the code in
> the decription stored procedure & decrypt & hence view the data.
> How can i prevent the administrator (everyone) except for the application
> from being able to view the data.
> Is it possible to remove access to a stored procedure even from an
> administrator & give access to a special user (the password of which is kn
ow
> only by the application)'
> Then again the owner of the above role will have access to the stored
> procedures!!

data driven web site

I am using vb .net 2003 with msde.

I have downloaded microsoft`s vbsdk setup and have it working pretty well until I get to the login page and the provided credentials will not work.

The sample tells me to set permissions in the dacl editor.

1:What is the dacl editor and how do I use it?

2:What do I set permissions to?

I have been through the code provided over and over and can`t seem to find anything wrong,So I figure maybe this is the problem.

Any help will be appreciated.

Davco

Hi,

this is a SQL Server related forum and this seems more like a problem within the SDk walkthrough. perhpas it would be better to try your question in the ASP.NET forums.

HTH, jens K. Suessmeyer.

http://www.sqlserver2005.de

Thursday, March 8, 2012

Data Binding-DataAdapter

Hi i'm a new to ASP.NET and for some reason when i click the Next button in the code below, the pageIndex does not change. Please assist, Basically what i'm trying to do is to use DataAdapter.fill but passing in the start index and the number of records to pull from the dataset table.

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Data.OleDb;

publicpartialclassHome : System.Web.UI.Page

{

//Connection

OleDbConnection dbConn;

//discount that can be change by user using a gui interface

//CurrentPage

int pageIndex = 0;double discount = 0.15 ;

protectedvoid Page_Load(object sender,EventArgs e)

{

// homeGridView.Visible = true;

BindList();

}

protectedstring getSpecial(string price,object sale)

{

String special ="";if (sale.ToString().CompareTo("True") == 0)

{

special =String.Format("{0:C}",double.Parse(price) * (1-discount));

}

return special;

}

protectedvoid BindList()

{

//Creating an object for the 'PagedDataSource' for holding the data.

//PagedDataSource objPage = new PagedDataSource();

try

{

//open connection

openConnection();

//sql command

string columns ="*";

string SqlCommand ="Select " + columns +" from Books";

//create adapters and DataSet

OleDbDataAdapter myAdapter =newOleDbDataAdapter(SqlCommand, dbConn);DataSet ds =newDataSet("bSet");

//create table

DataTable dt =newDataTable("Books");myAdapter.Fill(ds, pageIndex, 9,"Books");

Response.Write("Page Index: "+pageIndex);

//create table data view

DataView dv =newDataView(ds.Tables["bTable"]);

booksDataList.DataSource = ds;

booksDataList.DataBind();

myAdapter.Dispose();

dbConn.Close();

}

catch (Exception ex)

{

Response.Write("Exception thrown in BindList()");

dbConn.Close();

throw ex;

}

}

publicvoid openConnection()

{

string provider="Microsoft.Jet.OLEDB.4.0";

string dataSource ="C:/Documents and Settings/Owner/My Documents/Visual Studio 2005/WebSites/E-BookOnline/App_Data/BooksDB.mdb";

dbConn =newOleDbConnection("Provider =" + provider +";" +"Data Source =" + dataSource);

dbConn.Open();

}

protectedvoid nextClick(object sender,EventArgs e)

{

pageIndex=pageIndex+1;

Response.Write("In nextClick"+pageIndex);

BindList();

}

protectedvoid prevClick(object sender,EventArgs e)

{

if (pageIndex > 0)

{

pageIndex=pageIndex-1;

BindList();

}

}

}

It is not advisable to use DataAdpater to page records... instead of this you need to use queries for that but anyway you can found this article useful.

http://msdn2.microsoft.com/en-us/library/tx1c9c2f(VS.80).aspx

Satya

Data Binding with ReportViewer Control to an Independent Data Table

Here is what I am trying to do. I am using ASP.NET 2.0. I have created a data set called Stocks data table called Data and put it in the App_Code folder. I am filling the data table from data in a csv file located on the web. I am populating the data table with the following code. This code works because I checked the record count and it shows 21 records for the Data data table.

publicstaticDataSet Convert() { WebClient Client =newWebClient(); Stream myStream = Client.OpenRead("http://mysite.com/table.csv"); StreamReader myStreamReader =newStreamReader(myStream); Stocks myStocks =newStocks(); string line = myStreamReader.ReadLine(); string allData = myStreamReader.ReadToEnd(); string[] rows = allData.Split("\r\n".ToCharArray()); foreach (string rin rows) { string[] items = r.Split(",".ToCharArray()); myStocks.Tables["Data"].Rows.Add(items); } return myStocks; }

I am trying to bind the data in this table to a report. I added a report to my project and selected the fields from the data table. I then added a ReportViewer control to the web form. I'm not sure how to configure the ObjectDataSource that is added to the web form after the ReportViewer control is added. It firsts asks to select business object. I have the following options. I'm not sure what to select.

Stocks

Stocks + DataTable

Stocks + DataRow

Stocks + DataRowChangeEvent

Stocks + DataRowChangeEventHandler

Next I need to define a data method. Not sure what option to select. I just want to bind the report to the data table and return the rows.

Any help would be appreciated. Thanks.

Weste

Once you drag and drop the report viewer in the aspx page, you will get a smart tag next to your report viewe. From that select the repot.rdlc.

Itr will automatically configure the object datasorce for you.

Did you design your report.rdlc using the dataset you created?

|||

Yes, that is what I already tried and it didn't work. It didn't configure the datasource correctly. I received the following error.

An error has occurred during report processing.
The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource1' could not be found.

This is the code that was automatically added after I added the ReportViewer

<asp:ObjectDataSourceID="ObjectDataSource1"runat="server"SelectMethod="GetData"

TypeName="StcoksTableAdapters."></asp:ObjectDataSource>

I'm not sure how to configure the ObjectDataSource that is added to the web form after the ReportViewer control is added. It firsts asks to select business object. I have the following options. I'm not sure what to select.

Stocks

Stocks + DataTable

Stocks + DataRow

Stocks + DataRowChangeEvent

Stocks + DataRowChangeEventHandler

It then asks me to choose a method. Some of the available options are

Clone(), returns DataSet
Copy(), returns DataSet
CreateDataReader(), returns DataTableReader

I have done other reports using a SQL datasource and they work fine. It works somewhat different without a SQL datasource. I am having trouble finding any documentation to assist me. Thanks for your help.

Weste

|||

I resolved the issue. I added a class called StockData. I moved the code for the Convert procedure into this class. I then configured the ObjectDataSource as follows:

Business Object: StockData
Select Method: Convert(), returns DataSet

Wednesday, March 7, 2012

data application blocks for windows mobile

I've read that microsoft.applicationblocks.data for .net v2 can't be deployed to a mobile app, and my experience bears that out. So I 'm wondering if there are application blocks for windows mobile 5 that would know how to both talk to sql server mobile and sql server 2005. I see OpenNetCF has a port but as far as I can tell, they only address sql server mobile and not talking to a sql server 2005 remote database. I can use the OpenNetCF version for my sql server mobile requirements, but I'm hoping there is an encapsulation of sqlclient calls for communication with my server db.

thanks

braden

There is also a nice port at www.businessanyplace.net

http://www.businessanyplace.net/?p=daabcf

and someone did a dual database (SqlClient and System.Data.SqlServerCe) block in .Net Developer's Journal a few months ago as well.

-Darren

|||Thanks Darren. I ended up doing my own by copying the methods I needed from the full fw set.

Saturday, February 25, 2012

data acess class

hi
i was reading book about asp.net and i found example for a dataacess class but i didn't understand this part

Private m_FieldData As New NameObjectCollection
Private _m_ConnectionString As String
Private m_dbConnection As SqlConnection
Private Sub AddParameters( _
ByVal objCommand As SqlCommand, _
ByVal objValues() As Object)

Dim objValue As Object
Dim I As Integer
Dim objParameter As SqlParameter

objCommand.Parameters.Clear()
SqlCommandBuilder.DeriveParameters(objCommand)

I = 0
For Each objParameter In objCommand.Parameters
If objParameter.Direction = ParameterDirection.Input _
Or objParameter.Direction = _
ParameterDirection.InputOutput Then

objValue = objValues(I)
objParameter.Value = objValue
I = I + 1
End If
Next
End Sub

Private Sub AddFieldParameters _
(ByVal objCommand As SqlCommand)

Dim objParameter As SqlParameter

objCommand.Parameters.Clear()
SqlCommandBuilder.DeriveParameters(objCommand)

For Each objParameter In objCommand.Parameters
objParameter.Value = _
_FieldData.Item(objParameter.ParameterName. _
Substring(1))
Next
End Sub
Public Function ExecDataReader _
(ByVal strStoredProc As String, _
ByVal ParamArray objValues() As Object) _
As SqlDataReader

Dim objCommand As SqlCommand
Dim objReader As SqlDataReader

objCommand = New SqlCommand

objCommand.CommandText = strStoredProc
objCommand.CommandType = CommandType.StoredProcedure
objCommand.Connection = dbConnection

Try
objCommand.Connection.Open()
If (objValues.Length = 0) Then
AddFieldParameters(objCommand)
Else
AddParameters(objCommand, objValues)
End If
objReader = objCommand. _
ExecuteReader(CommandBehavior.CloseConnection)
Catch ex As Exception
If objCommand.Connection.State.Open Then
objCommand.Connection.Close()
End If
End Try

Return objReader
End Function
can anybody help me what the author want to doTamer, can you be more specific?

Thanks|||hi i don't understand sub AddParameters and addfieldparameter
and why to add values as an array
and the parameter have only one single value why to pass an array of object i can pass a single value hope u understand me|||I'm going to have to kind of guess here as I don't know the source or the context of the script. That being said

Looking at just the AddFieldParameters sub:
---------------------------------
Private Sub AddFieldParameters (ByVal objCommand As SqlCommand)

Dim objParameter As SqlParameter

objCommand.Parameters.Clear()
SqlCommandBuilder.DeriveParameters(objCommand)

For Each objParameter In objCommand.Parameters
objParameter.Value = FieldData.Item(objParameter.ParameterName.Substring(1))
Next
End Sub
---------------------------------

I read this as the SQL command is being passed into the sub as a value and that value can have multiple lines to it. The FieldData object is being created with each line of the SQL command as a different entry in the array.

The AddParameters looks pretty much the same.

Does this answer your question?

I can look into this further if you provide me with the origional source and location of the script.

Thanks

Data Acess aplication block

Hi
I have Microsoft Enterprise Library 2005 installed on my local system.
I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
Server 2000.
I am developing a web application in which i am using data Access
Application Block for data access.
I have a remote web n data server with asp.net 1.1 support
the application is working fine here on the local server(web & data).
when i change the data server path to the remote server it also working
fine but
When I uploaded the application on the remote server n tested there it
gives me the following err
ex.message was
[vbcol=seagreen]
ex.Source was
.........Microsoft.Practices.EnterpriseLibrary.Data
ex.trace was
at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFai
ledEvent.Fire(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentati
onFacade.ConnectionFailed(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandW
rapper
command) at property.m4.Button2_Click(Object sender, EventArgs e)
Plz help me why this is happening.........
Mukesh Kumar agarwal
Delhi
IndiaMukesh,
Are you sure that the user that ASP.NET is running under has access to
the database you are trying to reach? It seems as if this is an error on
connecting.
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]
- mvp@.spam.guard.caspershouse.com
"Mukesh" <efextra@.newsgroups.nospam> wrote in message
news:u6JBICB1GHA.4264@.TK2MSFTNGP05.phx.gbl...
> Hi
> I have Microsoft Enterprise Library 2005 installed on my local system.
> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
> Server 2000.
> I am developing a web application in which i am using data Access
> Application Block for data access.
> I have a remote web n data server with asp.net 1.1 support
> the application is working fine here on the local server(web & data).
> when i change the data server path to the remote server it also working
> fine but
> When I uploaded the application on the remote server n tested there it
> gives me the following err
>
> ex.message was
>
> ex.Source was
> .........Microsoft.Practices.EnterpriseLibrary.Data
> ex.trace was
> at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionF
ailedEvent.Fire(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumenta
tionFacade.ConnectionFailed(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBComman
dWrapper
> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>
> Plz help me why this is happening.........
> Mukesh Kumar agarwal
> Delhi
> India
>
>
>|||The error you are getting is because the enterprise library wants to write
events to the event log and setting this up requires registry permissions.
You need to installutil the dlls for the enterprise library (this is covered
in the docs somewhere). The reason it is writing to the event log is because
the connection failed. If you setup the event log access correctly then you
will have an eventlog entry telling you why the connection failed.
HTH
Ciaran O'Donnell
"Mukesh" wrote:

> Hi
> I have Microsoft Enterprise Library 2005 installed on my local system.
> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
> Server 2000.
> I am developing a web application in which i am using data Access
> Application Block for data access.
> I have a remote web n data server with asp.net 1.1 support
> the application is working fine here on the local server(web & data).
> when i change the data server path to the remote server it also working
> fine but
> When I uploaded the application on the remote server n tested there it
> gives me the following err
>
> ex.message was
>
> ex.Source was
> ..........Microsoft.Practices.EnterpriseLibrary.Data
> ex.trace was
> at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionF
ailedEvent.Fire(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumenta
tionFacade.ConnectionFailed(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBComman
dWrapper
> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>
> Plz help me why this is happening.........
> Mukesh Kumar agarwal
> Delhi
> India
>
>
>

Data Acess aplication block

Hi
I have Microsoft Enterprise Library 2005 installed on my local system.
I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
Server 2000.
I am developing a web application in which i am using data Access
Application Block for data access.
I have a remote web n data server with asp.net 1.1 support
the application is working fine here on the local server(web & data).
when i change the data server path to the remote server it also working
fine but
When I uploaded the application on the remote server n tested there it
gives me the following err
ex.message was
>>The type initializer for
>>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
>>threw an exception.
ex.Source was
.........Microsoft.Practices.EnterpriseLibrary.Data
ex.trace was
at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
connectionString) at
Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
command) at property.m4.Button2_Click(Object sender, EventArgs e)
Plz help me why this is happening.........
Mukesh Kumar agarwal
Delhi
IndiaMukesh,
Are you sure that the user that ASP.NET is running under has access to
the database you are trying to reach? It seems as if this is an error on
connecting.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@.spam.guard.caspershouse.com
"Mukesh" <efextra@.newsgroups.nospam> wrote in message
news:u6JBICB1GHA.4264@.TK2MSFTNGP05.phx.gbl...
> Hi
> I have Microsoft Enterprise Library 2005 installed on my local system.
> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
> Server 2000.
> I am developing a web application in which i am using data Access
> Application Block for data access.
> I have a remote web n data server with asp.net 1.1 support
> the application is working fine here on the local server(web & data).
> when i change the data server path to the remote server it also working
> fine but
> When I uploaded the application on the remote server n tested there it
> gives me the following err
>
> ex.message was
>
> >>The type initializer for
> >>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
> >>threw an exception.
> ex.Source was
> .........Microsoft.Practices.EnterpriseLibrary.Data
> ex.trace was
> at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>
> Plz help me why this is happening.........
> Mukesh Kumar agarwal
> Delhi
> India
>
>
>|||The error you are getting is because the enterprise library wants to write
events to the event log and setting this up requires registry permissions.
You need to installutil the dlls for the enterprise library (this is covered
in the docs somewhere). The reason it is writing to the event log is because
the connection failed. If you setup the event log access correctly then you
will have an eventlog entry telling you why the connection failed.
HTH
Ciaran O'Donnell
"Mukesh" wrote:
> Hi
> I have Microsoft Enterprise Library 2005 installed on my local system.
> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
> Server 2000.
> I am developing a web application in which i am using data Access
> Application Block for data access.
> I have a remote web n data server with asp.net 1.1 support
> the application is working fine here on the local server(web & data).
> when i change the data server path to the remote server it also working
> fine but
> When I uploaded the application on the remote server n tested there it
> gives me the following err
>
> ex.message was
>
> >>The type initializer for
> >>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
> >>threw an exception.
> ex.Source was
> ..........Microsoft.Practices.EnterpriseLibrary.Data
> ex.trace was
> at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
> connectionString) at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>
> Plz help me why this is happening.........
> Mukesh Kumar agarwal
> Delhi
> India
>
>
>|||Hi all
As per my earlier conversation with Ciaran (thx for reply) I have
installed the MS APplication block on the server , when i ran Build
Enterprise Library file and Install Services from (batch files )
programme files menu it was asking for visual studio 2003 , I have only
.net framework on the server how can i use the MS application block
data access library on my server plz help...
Mukesh Agarwal
mukesh.nitb@.gmail.com
Delhi India
Ciaran O''Donnell wrote:
> The error you are getting is because the enterprise library wants to write
> events to the event log and setting this up requires registry permissions.
> You need to installutil the dlls for the enterprise library (this is covered
> in the docs somewhere). The reason it is writing to the event log is because
> the connection failed. If you setup the event log access correctly then you
> will have an eventlog entry telling you why the connection failed.
> HTH
> Ciaran O'Donnell
> "Mukesh" wrote:
>> Hi
>> I have Microsoft Enterprise Library 2005 installed on my local system.
>> I m also using ASp.net 1.1 And C3 as coding language , I have MS Sql
>> Server 2000.
>> I am developing a web application in which i am using data Access
>> Application Block for data access.
>> I have a remote web n data server with asp.net 1.1 support
>> the application is working fine here on the local server(web & data).
>> when i change the data server path to the remote server it also working
>> fine but
>> When I uploaded the application on the remote server n tested there it
>> gives me the following err
>>
>> ex.message was
>>
>> >>The type initializer for
>> >>"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent"
>> >>threw an exception.
>> ex.Source was
>> ..........Microsoft.Practices.EnterpriseLibrary.Data
>> ex.trace was
>> at
>> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String
>> connectionString) at
>> Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String
>> connectionString) at
>> Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at
>> Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper
>> command) at property.m4.Button2_Click(Object sender, EventArgs e)
>>
>> Plz help me why this is happening.........
>> Mukesh Kumar agarwal
>> Delhi
>> India
>>
>>
>>|||Hello Mukesh,
As for the installation of instrumentation servcie of enterprise library
2005, I've posted some information from the enterprise lib's product
team(in your another duplicated thread in the
microsoft.public.dotnet.languages.csharp newsgroup) which include:
** how disable instrumentation of enterprise library (through custom build)
when deploy them to product environment.
** how to install the instrumentation services without vs 2003
installed(use the installUtil.exe in .net framework utilities):
For your convenience, I've pasted my reply in that thread below:
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
=============================================Hi Mukesh,
As for the Enterprise Library(2005) for .net framework 1.1, the
instrumentation services does need to be installed separately. And the
"install services" bat file does require the VS 2003 IDE installed on the
machine. Actually this is because instrumetation feature is mainly used in
development environment. For production environment, generally we do not
use them and can disable the setting at compilation time(through some build
flags).
Therefore, for your scenario, you can consider the following options:
1. Build a product version of the enterprise library which disable the
instrumentation in the build options(some conditional compile variables).
2. Instead of using the "Install Services" bat file, use the
InstallUtil.exe utility(shipped with .net framework 1.1 rather than vs
2003) to register the instrumentation service against each enterprise
library assembly (you will use in your application).
Here is a blog article from the product manager of enterprise library
(pattern&practice team) which has provide a complete description on the
instrumentation services of Enterprise library 2005(.net 1.1) and how to
disable it in custom build or install the service without VS 2003 IDE:
#Instrumentation in Enterprise Library
http://blogs.msdn.com/tomholl/archive/2005/02/18/376187.aspx
Hope this helps.
Sincerely,
Steven Cheng
===============================================================

Data access using Ent. Library Jan. 2006 release

Hello ...

Using Ent. Library Jan. 2006 release and .Net Framework 2.0, I'm connecting to SQL Server 2000 using Microsoft.Practices.EnterpriseLibrary.Data.Sql.

I have a windows service that processes jobs asynchronously and from time to time, I'm getting the following error --

"A connection was successfully established with the server, but then an error occurred during the pre-login handshake. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (TCP Provider error: 0 - An existing connection was forcibly closed by the remote host. "

What's surprising is the error message saying SQL Server 2005. Has anyone encountered and resolved this?

Thanks.

allanroy

I guess you installed the SNAC on your system, right ? Thats where the message comes from.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

What is SNAC?

Thanks.

allan

|||Nothing to eat ;-) It s the SQL Native Client.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

The SQL Native Client is installed in my client machine and not on the server that host the SQL Server 2000 and my windows services. Ones a job is requested from a client machine, the process is asynchronous and processing happens only on the server.

allan

|||Are you using connection pooling, if yes it could be that the connection used is not released from the pool, leading to the error message, that the server cannot be contacted.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

data access from sql 2005

i am using asp.net with sql 2005.

here i am having lakhs of records .

when we retrive the records it became very slow. it takes long time to retrive the datas from sql.

i used index,stored procedure,but no use. Any one know how to access the datas in fast manner.

First question would be have you tried executing the stored procedure directly from SQL Query Analyser / Management Studio? This is to determine whether it is a database issue or application issue?

If this is a database issue then you will have to look into appropriate column indexing, minimising table joins, optimise the query execution plan

If it points to an application issue, then make sure you are disposing connection objects, use appropriate command objects like readers and adapters, only fetch data you need, consider caching if the data is static in nature

Friday, February 24, 2012

Damaged PDF files

Hi,
I have created a web application with ASP.Net 2.0. I also have created a
report using Reporting Services 2005. After showing the report on the
screen, I give the suer the possibility to export to report. One of the
possibilities is PDF. Now we have some troubles with this export.
On some PC's after saving or opening the PDF we got the message :
"There was an error opening this document. The file is damaged and could
not be repaired"
It only appears on some PC's, on other PC's exporting the same documents
works fine. It also didn't have any effect on the version of Acrobat. The
problems comes with Acro v 5, 7 and 8. Even after upgrading, deinstalling,
rebooting, installing a newer version the problem still exists on those PC's.
So I hope that someone have a solution for this as we don't know if it's a
problem with reporting services or with acrobat.
Txs in advance.On Apr 30, 4:36 am, Cipidos <Cipi...@.discussions.microsoft.com> wrote:
> Hi,
> I have created a web application with ASP.Net 2.0. I also have created a
> report using Reporting Services 2005. After showing the report on the
> screen, I give the suer the possibility to export to report. One of the
> possibilities is PDF. Now we have some troubles with this export.
> On some PC's after saving or opening the PDF we got the message :
> "There was an error opening this document. The file is damaged and could
> not be repaired"
> It only appears on some PC's, on other PC's exporting the same documents
> works fine. It also didn't have any effect on the version of Acrobat. The
> problems comes with Acro v 5, 7 and 8. Even after upgrading, deinstalling,
> rebooting, installing a newer version the problem still exists on those PC's.
> So I hope that someone have a solution for this as we don't know if it's a
> problem with reporting services or with acrobat.
> Txs in advance.
I've never seen this occur before; however, from what you are saying,
it seems that it is a non-Reporting Services issue. Traditionally, if
it was SSRS, then all of the machines would be behaving the same way.
It may not be related to Acrobat either; however, I'm not sure what
could be causing the problem (missing Adobe update, missing MS Office
update, etc). Sorry that I could not be of further assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Friday, February 17, 2012

DAAB ( sqlhelper ) Problem

Hi,

i am using sql 2000 and VS2005 ASP.NET 2.0

i have a problem using sqlhelper although i didn't notice it before (i've use it a lot)

the problem summarize as increasing of the connection (mayb 50+ for one user) which results in an pool size "Overflow"

i navigated the net i found many people speaking of an alternative from microsoft.

- i would like to know more information about the problem and

- is it the best alternative or not?

- and what is the best alternative?

thanx in advance

i would be pleased if you provide me with information

When using the DAAB to create datareaders, the default behavior is that the DAAB will create the connection from a connectionsting and when you have fully iterated over the datareader, the connection will automatically close. this occurs because the daab uses the commandbehavior of: CloseConnection

http://msdn2.microsoft.com/en-us/library/system.data.commandbehavior.aspx

Since you're leaking connections, you must be doing something to open these connections yourself and you will need to make sure that you close the connections when you are done with them.

TheEnterprise Library supercedes the DAAB, but switching to it will likely not solve your problem as you have a connection leak somewhere that you will really need to find in your code.