Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Friday, March 23, 2012

How to increase the SQL Server memory

We are using SQL server 7.0, our users use to connect to SQL server remotely using Visual Basic Application. When all the users are connected it keeps on increasing the memory utilization and at 1,836,848 KB memory utilization it stops increasing the memory i.e memory utilization become stangnet. The actual amount of physical Memory is around 5GB but SQL server dont increase it after the treshhold level and the performance of the server get affected badly. Any one please suggest me the possible solution.In Enterprise Manager,
- right click on the server name and choose properties.
- choose memory tab

You should be able to set your min/max memory settings there. Also look into worker threads (on the processor tab).

Something else to think about,
How big is the DB (Gigs) ? How big are the tables being referenced? Perhaps something could be re-designed to make things more efficient. Are there a lot of table scans where you could have indexes, etc..?

Also,
Open the performance moniter and check the sql counters..

More info at -> http://www.sql-server-performance.com/performance_monitor_tips.asp|||It looks like you're running Standard Edition of SQL2K, which will not recognize any more memory, period! You need to upgrade to Enterprise and then you'll have more options:

1. /3GB in boot.ini will allow SQL Server to use more than the default 2GB
2. /PAE in boot.ini and enabling AWE on SQL Server will give SQL service whatever amount you specify.

Monday, March 19, 2012

How to import report from report server

Hi,
Is there any way to import existing report from report server (Sql 2005)
into visual studio report designer?.
Thanks in advance.This is not very discoverable. In Report Manager click on the report,
properties tab, edit link. It will ask for a directory. Give it a directory
on your PC (for instance c:\temp). The in the designer right click on the
reports folder for your project, add, existing item.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Radovan Dobriæ" <radovan@.servis24.hr> wrote in message
news:O3CB07mXIHA.5448@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Is there any way to import existing report from report server (Sql 2005)
> into visual studio report designer?.
> Thanks in advance.
>|||Thanks a lot.
I was allways looking in VS for import option,
Radovan
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:OXzqYdpXIHA.4868@.TK2MSFTNGP03.phx.gbl...
> This is not very discoverable. In Report Manager click on the report,
> properties tab, edit link. It will ask for a directory. Give it a
> directory on your PC (for instance c:\temp). The in the designer right
> click on the reports folder for your project, add, existing item.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Radovan Dobriæ" <radovan@.servis24.hr> wrote in message
> news:O3CB07mXIHA.5448@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> Is there any way to import existing report from report server (Sql 2005)
>> into visual studio report designer?.
>> Thanks in advance.
>

Friday, February 24, 2012

How to implement a DropDownList w/o a Table

I am using Visual Studio 2005 & SQL Server. How do i implement a DDL for users to select which value to input. like i can with Access. i do not need a table i think. if not the table would have only ID & Value.?

If you want a static set of items in the dropdown list you can define them in the property panel under the property Items you will find a collection, click the "..." and add items with value and text to appear in the dropdown list.

Best regards,
Per Salmi

|||

If you're trying to get the values from the database, you can do something like this:

Sub Page_Load(ByVal senderAs Object,ByVal eAs EventArgs)

If Not Page.IsPostBackThen GetData()End If
End Sub

Sub GetData()

Dim connStringAs String
Dim conAs SqlConnection

Try connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("ConnectionString1").ConnectionString

con =New SqlConnection(connString)

Dim cmdAs SqlCommand =New SqlCommand()
Dim readerAs SqlDataReader

cmd.Connection = con

cmd.CommandText ="EXECUTE dbo.GetDepartmentCode" reader = cmd.ExecuteReaderIf reader.HasRowsThen
While (reader.Read)
Dim newItemAs New ListItem
newItem.Text = (reader.Item("DeptCode")).ToString
newItem.Value = (reader.Item("DeptCode")).ToString
deptCodeDDL.Items.Add(newItem)
End While
End If reader.Close()Catch exAs Exception
Response.Write(ex)
Finally con.Close() con.Dispose()End Try

Catch exAs ApplicationException
Response.Write("Could not load the database")
End Try
End Sub


The ASP.Net side would like this:

<asp:DropDownList ID="deptCodeDDL" runat="server"></asp:DropDownList>

A few things to note though.

In the code I've posted, I use a stored procedure (sproc) to retrieve the data from the database. If you don't what sprocs are, you can read about themhere. Using sprocs is generally considered a better way of accessing the db.

Also, you will of course, have to replace DeptCode with the column name from where you will be getting the values.

Finally, I use a ConnectionString, which is being retrieved from the Web.config file. You should have that in you application folder.

If you don't, given below is a sample:

<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
--><configuration>
<appSettings/>
<connectionStrings>
<add name="ConnectionString1" connectionString="Data Source=SERVERNAME\SQLSERVER;Initial Catalog=DBNAME;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
--><compilation debug="false"
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
--><authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
--></system.web>
</configuration>

You will have to replace SERVERNAME with you server name and DBNAME with your db name.