22 Mayıs 2007 Salı

The database could not be exclusively locked to perform the operation.


The database could not be exclusively locked to perform the operation.

ALTER DATABASE bsy SET SINGLE_USER WITH ROLLBACK IMMEDIATE
alter database bsy collate SQL_Latin1_General_CP1_CI_AS
ALTER DATABASE bsy SET MULTI_USER

30 Ocak 2007 Salı

ASP.Net yeni POP-UP pencere açma c#

public void PencereAc(Page p_sayfa,string p_text)
{
string _value="<"+"script language='javascript'"+">window.open('"+ p_text +"', 'newwindow','width=500, height=400,left=300,top=300,toolbar=no, menubar=no, scrollbars=no, resizable=no');<"+"/script"+">";
p_sayfa.RegisterStartupScript("BenimKey", _value);

29 Ocak 2007 Pazartesi

Asp.Net Yeni pencere açma(open new window)

window.open(URL,name,specs,replace)





















ParameterDescription
URLOptional. Specifies the URL of the page to open. If no URL is specified, a new window with about:blank
is opened
name

Optional. Specifies the target attribute or the name of the window. The following values are supported:



  • _blank - URL is loaded into a new window. This is default

  • _parent - URL is loaded into the parent frame

  • _self - URL replaces the current page

  • _top - URL replaces any framesets that may be loaded

  • name - The name of the window


specs

Optional. A comma-separated list of items. The following
values are supported:






























































channelmode=yes|no|1|0Whether or not to display the window in theater mode. Default is no
directories=yes|no|1|0Whether or not to add directory buttons. Default is yes
fullscreen=yes|no|1|0Whether or not to display the browser in full-screen mode. Default is no. A window in full-screen mode must also be in theater mode
height=pixelsThe height of the window. Min. value is 100
left=pixelsThe left position of the window
location=yes|no|1|0Whether or not to display the address field. Default is yes
menubar=yes|no|1|0Whether or not to display the menu bar. Default is yes
resizable=yes|no|1|0Whether or not the window is resizable. Default is yes
scrollbars=yes|no|1|0Whether or not to display scroll bars. Default is yes
status=yes|no|1|0Whether or not to add a status bar. Default is yes
titlebar=yes|no|1|0Whether or not to display the title bar. Ignored unless the calling application is an HTML Application or a trusted dialog box. Default is yes
toolbar=yes|no|1|0Whether or not to display the browser toolbar. Default is yes
top=pixelsThe top position of the window
width=pixelsThe width of the window. Min. value is 100



replace


Optional.Specifies whether the URL creates a new entry or replaces the current entry in the history list.
The following values are supported:



  • true - URL replaces the current document in the history list

  • false - URL creates a new entry in the history list


Örnek:

window.open ('titlepage.html', 'newwindow', config='height=100,
width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no')


25 Ocak 2007 Perşembe

Asp.net Refresh Sorunu

Sub Page_Load (sender As Object, e As EventArgs)
If Not Page.IsPostBack
Session("update") = Server.URLEncode(System.DateTime.Now.ToString())
End If
End Sub

Sub Page_PreRender (sender As Object, e As EventArgs)
ViewState("update") = Session("update")
End Sub

Sub Button1_Click(sender As Object, e As EventArgs)
If Session("update").ToString() = ViewState("update").ToString() Then
If AddEmployee(firstName.Text, lastName.Text) = 0
Message.Text = "Success"
Session("update") = Server.URLEncode(System.DateTime.Now.ToString())
Else
Message.Text = "Failure"
End If
Else
Message.Text = "Failure - Session"
End If
firstName.Text = ""
lastName.Text = ""
End Sub

24 Ocak 2007 Çarşamba

In Search Of ASP.Net Controls(Posted by K. Scott Allen)

The FindControl method of the System.Web.UI.Control class appears simple enough to use. In fact, the MSDN description of the method is one simple sentence:


Searches the current naming container for the specified server control.


The key to using FindControl is to invoke the method on the correct container. As a warm up, let’s say we have the following form inside of an aspx page.


<form id="Form1" method="post" runat="server">
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
</form>



Although we can declare a member variable in our code behind class to reference TextBox1, let’s use the FindControl method in an event handler.


private void Button1_Click(object sender, System.EventArgs e)
{
TextBox b = Page.FindControl("TextBox1") as TextBox;
if(b != null)
{
Response.Write("Found TextBox1 on Button1_Click<br>");
}
}


The above code will find TextBox1 and write a message into the response stream. But what happens when the TextBox is not a child of the control we query with FindControl? Consider the following form.


<form id="Form1" method="post" runat="server">
<asp:Panel id="Panel1" runat="server" Height="152px">
Panel
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>

<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
</asp:Panel>
</form>


In the above form, the parent of TextBox1 is the Panel control Panel1. Let’s use the same event handler we used in the first example and see what happens.



Once again we have easily located the control. For later comparison, let’s view an excerpt of the HTML source the ASP.NET form has given us.


<div id="Panel1" style="height:152px;">

Panel
<input name="TextBox1" type="text" id="TextBox1" />
<input type="submit" name="Button1" value="Button" id="Button1" />
</div>


In the source above we can see ASP.NET has given the TextBox a client side ID of TextBox1, the same ID we use on the server. This behavior changes when we place the textbox inside of a control implementing the INamingContainer interface, which will change the way we use the FindControl method. Any control implementing INamingContainer will create a new control namespace so that all child controls will have a unique ID on the page. In short, an INamingContainer control will guarantee there are no naming conflicts on a page. This behavior is best demonstrated with an example.


FindControl in a DataGrid


There are several ASP.NET controls which implement INamingContainer, including the DataGrid, the Repeater, and the DataList. Let’s build a form with a DataGrid and view the HTML output.



<form id="Form1" method="post" runat="server">
<asp:DataGrid id=DataGrid1 runat="server" DataSource="<%# employees1 %>"
AutoGenerateColumns="False"
OnSelectedIndexChanged="DataGrid1_SelectedIndexChanged"
OnEditCommand="DataGrid1_EditCommand">
<Columns>
<asp:BoundColumn DataField="emp_id" SortExpression="emp_id" HeaderText="emp_id"/>
<asp:BoundColumn DataField="fname" SortExpression="fname" HeaderText="fname"/>
<asp:BoundColumn DataField="lname" SortExpression="lname" HeaderText="lname"/>

<asp:TemplateColumn>
<ItemTemplate>
<asp:TextBox Runat="server" ID="TextBox1" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn Text="Select" CommandName="Select"></asp:ButtonColumn>

<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" EditText="Edit">
</asp:EditCommandColumn>
</Columns>
</asp:DataGrid>
</form>


The DataGrid in the form will display data from a well known SQL Server table. Using a TemplateColumn, we will add a TextBox control with the ID of TextBox1 to each row of the grid. Let’s take a look at an excerpt of the HTML ASP.NET generates.



<table cellspacing="0" rules="all" border="1" id="DataGrid1">
<tr>
<td>emp_id</td><td>fname</td><td>lname</td><td> </td><td> </td><td> </td>

</tr>
<tr>
<td>A-C71970F</td><td>Aria</td><td>Cruz</td><td>

<input name="DataGrid1:_ctl2:TextBox1" type="text" id="DataGrid1__ctl2_TextBox1" />
</td><td>
</tr>
<tr>
<td>A-R89858F</td><td>Annette</td><td>Roulet</td><td>

<input name="DataGrid1:_ctl3:TextBox1" type="text" id="DataGrid1__ctl3_TextBox1" />
</td><td>
</tr>


Here we can see there are many instances of TextBox1, but each ID is prefixed with some additional identifier information. This behavior shows the INamingContainer objects at work. The DataGrid implements INamingContainer and will preface each child control ID with ‘DataGrid1’. As we will see shortly, a DataGrid uses a collection of DataGridItem controls to represent each row of data. A DataGridItem control also implements INamingContainer, and will preface the name of child controls with a it’s own generated identifier (‘_ctrl2’, ‘_ctrl3’, etc.).


Now, if we used the following code, FindControl will return a null value


Control c = Page.FindControl(“TextBox1”)



The Page control cannot find a TextBox1 because the TextBox controls hide themselves inside of INamingContainer controls. Besides, which control would we really expect FindControl to return? The first TextBox control of the page? The last TextBox control? Typically, when you want to find a TextBox inside of a DataGrid, you’ll be looking for a TextBox on a specific row the user has chosen. For example, we added a Select column to allow the user to click on a hyperlink to chose the selected row. Let’s try to grab the TextBox control in the SelectedIndexChanged event.


private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
{
TextBox b;
b = DataGrid1.Items[DataGrid1.SelectedIndex].FindControl("TextBox1") as TextBox;
if(b != null)
{
Response.Write("Sender = " + sender.GetType().ToString() + "<br>");
Response.Write("Found Textbox1 in SelectedIndexChanged event<br>");
Response.Write(FindUtil.DumpParent(b));
}
}


The code invokes FindControl on the selected DataGridItem object. The code above will work, as demonstrated in the following figure.



We have also added some additional output to clearly see the chain of ownership leading to our TextBox. The TextBox1 control has a TableCell object as a parent, which in turn is a child control of a DataGridItem object, and so on up the line until we reach a Page control. The code to produce this dump is next.


public class FindUtil
{
public static string DumpParents(Control c)
{
StringBuilder sb = new StringBuilder();
sb.Append(c.ID + " (" + c.GetType().ToString() + ")");

while(c.Parent != null)
{
c = c.Parent;
sb.Append(" -><br>");
sb.Append(c.ID + " (" + c.GetType().ToString() + ")");
}

return sb.ToString();
}
}



The code will walk up the Parent control references building a string of control IDs (when a control ID exists – not all controls in a form will have a server side ID), and the control type.


We also added an EditCommandColumn to our DataGrid for the user to select a row to edit. Working with the EditCommand event handler is slightly easier, because the second parameter to the handler is of type DataGridCommandEventArgs, which contains a reference to the DataGridItem the user has selected for interaction.


protected void DataGrid1_EditCommand(object source,
DataGridCommandEventArgs e)
{
TextBox b;
b = e.Item.FindControl("TextBox1") as TextBox;
if(b != null)
{
Response.Write("Found Textbox1 in EditCommand event<br>");
}
}


Finding Controls In Headers and Footers


For some DataGrid objects you may want to display an interactive control inside of the header or footer section. These cases require a slightly different method of attack with FindControl. Consider the following form


<asp:DataGrid id=DataGrid1 runat="server" DataSource="<%# employees1 %>"
AutoGenerateColumns="False" ShowFooter="True">

<Columns>
<asp:BoundColumn DataField="emp_id" SortExpression="emp_id" HeaderText="emp_id"/>
<asp:BoundColumn DataField="fname" SortExpression="fname" HeaderText="fname"/>
<asp:BoundColumn DataField="lname" SortExpression="lname" HeaderText="lname"/>
<asp:TemplateColumn>
<HeaderTemplate>

<asp:DropDownList Runat="server" ID="DropDownList1">
<asp:ListItem Value="1">One</asp:ListItem>
<asp:ListItem Value="2">Two</asp:ListItem>
<asp:ListItem Value="3">Three</asp:ListItem>

</asp:DropDownList>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox Runat="server" ID="TextBox1" />
</ItemTemplate>
<FooterTemplate>

<asp:DropDownList Runat="server" ID="Dropdownlist1">
<asp:ListItem Value="1">One</asp:ListItem>
<asp:ListItem Value="2">Two</asp:ListItem>
<asp:ListItem Value="3">Three</asp:ListItem>

</asp:DropDownList>
</FooterTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn Text="Select" CommandName="Select"></asp:ButtonColumn>
</Columns>
</asp:DataGrid>



Here we have added a DropDownList control into the HeaderTemplate and FooterTemplate of the DataGrid. We should know at this point we cannot call FindControl on the Page, or on the DataGrid to retrieve these controls, because they will exist inside of another INamingContainer control, specifically a DataGridItem. What might be suprising however, is how we cannot use the DataGrid object’s Items collection as we did earlier. MSDN documentation has the following to say about the Items collection.


Note: Only items bound to the data source are contained in the Items collection. The header, footer, and separator are not included in the collection.


So we will not find the header and footer DataGridItem controls inside the Items collection, but all child controls must exist inside the Controls collection. In this case, our earlier dump of the DataGrid control hierarchy will prove useful. We know the parent of each DataGridItem is a DataGridTable, and the parent of the DataGridTable is the DataGrid control itself. We will have to assume the DataGridTable is the first control in the DataGrid, and the header row will be the first control of the DataGridTable (consequently the footer is the last control of the DataGridTable). Thus the following code:


private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
{
DropDownList d;
d = DataGrid1.Controls[0].Controls[0].FindControl("DropDownList1") as DropDownList;
if(d != null)
{
Response.Write("Found header DropDownList1 in SelectedIndexChanged event<br>");
}

int footerIndex = DataGrid1.Controls[0].Controls.Count-1;
d = DataGrid1.Controls[0].Controls[footerIndex].FindControl("DropDownList1") as DropDownList;
if(d != null)
{
Response.Write("Found footer DropDownList1 in SelectedIndexChanged event<br>");
Response.Write(FindUtil.DumpParents(d));
}
}


will give us both DropDownList controls in the header and footer, and produce the following output.




Seeing hard coded index values into the Controls collection is a bit worrisome. If your control changes, or the DataGrid control changes in a newer version of the framework, this code could break. An alternate solution could involve looping through the DataGridTable controls looking for DataGridItem objects with a ItemType property equal to ListItem.Header or ListItem.Footer. Whichever you decide, neither feels extremely robust in the face of future changes.


FindControl in Repeater controls


Like the DataGrid, the Repeater is an INamingContainer. Let’s take a look at the following form which displays authors from SQL Server.


<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem, "au_id")%></td>

<td><%#DataBinder.Eval(Container.DataItem, "au_lname")%></td>
<td><%#DataBinder.Eval(Container.DataItem, "au_fname")%></td>
<td><asp:TextBox Runat="server" ID="TextBox1" /></td>
<td><asp:Button Runat="server" ID="Button1" OnClick="Button1_Click" Text="Click" /></td>

</tr>
</ItemTemplate>
</asp:Repeater>


Each row of the repeater will contain a TextBox and Button control. Every Button control will use the same event handler where we can grab the corresponding TextBox control in the row with the following code.


protected void Button1_Click(object sender, System.EventArgs e)
{
Button btn = sender as Button;
TextBox tb = btn.Parent.FindControl("TextBox1") as TextBox;
if(tb != null)
{
Response.Write("Found TextBox1 in Button1_Click event<br>");
Response.Write(FindUtil.DumpParents(tb));
}
}



Here you can see we have taken a different tack by asking for the parent of the Button control which has fired the event handler. In the following screen shot, you can see the parent of the TextBox (and the Button) is a RepeaterItem control (which also implements INamingContainer). Thus the first TextBox appearing on the screen will have an unique ID of Repeater1:_ctl0:TextBox1.



One more tip before we move to the last section. Suppose we added a second button at the bottom of the form with the repeater. When the user clicks this button we want to loop the repeater collecting the contents of each TextBox control from every row. You can accomplish this task with the following code.


private void Button2_Click(object sender, System.EventArgs e)
{
foreach(RepeaterItem item in Repeater1.Items)
{
TextBox b = item.FindControl("TextBox1") as TextBox;
Response.Write(b.Text + "<br>");
}
}


User Controls


For the sake of completeness, let’s take a look at how FindControl works when a User Control (ascx) appears. Let’s through the following user control into a form.


<%@ Control Language="c#"
AutoEventWireup="false"
Codebehind="MyUserControl.ascx.cs"
Inherits="aspnet.FindControls.MyUserControl"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"
%>

<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>


If we view the HTML output, we will see the following.

   <input name="MyUserControl1:TextBox1" type="text" id="MyUserControl1_TextBox1" />
<input type="submit" name="MyUserControl1:Button1" value="Button" id="MyUserControl1_Button1" />



Although user controls do not implement INamingContainer, they do ensure their child controls will not have a naming conflict. For instance, if we placed two of these user controls on the same form, without munging the names we would have two TextBox1 controls on the same form.


Although you generally will not need to do this, you can find a control from the code behind of a user control as easily as the first example in this article


private void Button1_Click(object sender, System.EventArgs e)
{
TextBox b = this.FindControl("TextBox1") as TextBox;
if(b != null)
{
Response.Write("Found TextBox1 on User Control Button1_Click<br>");
}
}


If you wanted to find the TextBox control from inside of the parent page (not recommended, but here for completeness), you would have to invoke FindControl on the user control. In the following example, we will also use FindControl to find our user control.


private void Page_Load(object sender, System.EventArgs e)
{
MyUserControl u = FindControl("MyUserControl1") as MyUserControl;
TextBox b = u.FindControl("TextBox1") as TextBox;
if(b != null)
{
Response.Write("Found TextBox1 on Page_Load<br>");
}
}


Conclusion



Hopefully this article has shed some light and will offer some assistance to those readers who have lost wayward controls. The behavior of FindControl makes perfect sense once you understand the purpose of INamingContainer and begin using FindControl on the correct objects.


-- by K. Scott Allen



22 Ocak 2007 Pazartesi

Asp.Net Encryption/Decryption Query String with DES Base64 encoded.

Example:


class Sifreleme.cs
--------------------------------------------------------------------------
using System.Text;
using System.Security.Cryptography;
using System;
using System.IO;
using System.Xml;

namespace Sifreleme2
{
///


/// Summary description for Class1.
///




public class Encryption64
{
//private byte[] key = {};
//private byte[] IV = {10, 20, 30, 40, 50, 60, 70, 80}; // it can be any byte value

public string Decrypt( string stringToDecrypt,
string sEncryptionKey)
{

byte[] key = {};
byte[] IV = {10, 20, 30, 40, 50, 60, 70, 80};
byte[] inputByteArray = new byte[stringToDecrypt.Length];

try
{
key = Encoding.UTF8.GetBytes(sEncryptionKey.Substring(0,8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
inputByteArray = Convert.FromBase64String(stringToDecrypt);

MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(key, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();

Encoding encoding = Encoding.UTF8 ;
return encoding.GetString(ms.ToArray());
}
catch (System.Exception ex)
{
throw ex;
}
}

public string Encrypt( string stringToEncrypt,
string sEncryptionKey)
{

byte[] key = {};
byte[] IV = {10, 20, 30, 40, 50, 60, 70, 80};
byte[] inputByteArray; //Convert.ToByte(stringToEncrypt.Length)

try
{
key = Encoding.UTF8.GetBytes(sEncryptionKey.Substring(0,8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
inputByteArray = Encoding.UTF8.GetBytes(stringToEncrypt);
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(key, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();

return Convert.ToBase64String(ms.ToArray());
}
catch (System.Exception ex)
{
throw ex;
}
}
}

}
----------------------------------------------------------------------------------------------------
WebForm1.aspx
-------------------------------------------------------------------------------------------------------
Controls:TextBox1 and Button1


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Security.Cryptography;

namespace Sifreleme2
{
///
/// Summary description for WebForm1.
///

public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void Button1_Click(object sender, System.EventArgs e)
{
Encryption64 asd=new Encryption64 ();
string iso=asd.Encrypt(TextBox1.Text,"!#$a54?3");
Response.Redirect("WebForm2.aspx?search="+iso);

}
}
}
-------------------------------------------------------------------------------------------------------------------------------------
WebForm2.aspx
----------------------------------------------------------------------------------------------------------------------------------
Controls: TextBox1

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Security.Cryptography;

namespace Sifreleme2
{
///
/// Summary description for WebForm1.
///

public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void Button1_Click(object sender, System.EventArgs e)
{
Encryption64 asd=new Encryption64 ();
string iso=asd.Encrypt(TextBox1.Text,"!#$a54?3");
Response.Redirect("WebForm2.aspx?search="+ iso);

}
}
}
--------------------------------------------------------------------------------------------------------------------------------------

İyi Günler,
İsmail tutumluer

The name 'Session' does not exist in the class or namespace

The name 'Session' does not exist in the class or namespace

Solution:c#
System.Web.HttpContext.Current.Session["name"]

16 Ocak 2007 Salı

ASP.Net Error the two need to map to the same server location

Nedeni:ISS 6.0'da güvenlik nedeniyle .tmp extension engeliyor.
Yapmanız gereken;

Denetim Masasından ordan da Yönetimsel araçlara ordan ISS özelliklerini gideceksin.

the two need to map to the same server location

Web sitelerinin içinde gerekli projeni bulacak sağ tıklayıp özelliklerine gideceksin.




HHTP Headers sekmesinde MINE TYpes yanındaki File TYpes tıklayacaksın New Type diyeceksin.



Extension yanına .tmp ,Mine Type'da Temp yazacaksın.





Sorununuz hal olacaktır.


Gerekli Linkler:
http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=57
http://support.microsoft.com/kb/327283

The version of the report server database is either in a format that is not valid, or it cannot be read. The found version is 'Unknown'. The expected

Solution:Reinstall Reporting Service

Step 1: Backup your files and remove RS entirely.
==================================
If RS cannot be removed successfully, perform the following steps:


1. Re-run the setup.exe of Reporting Services that you had installed on
the machine before. Once this setup routine started it will detect the
existing installation and gave you an option to remove it.


2. If the issue still exists, run MSI installer clean up tool to uninstall
Reporting Services:

a. Please download the MSI installer clean up tool from the following web
site:

Description of the Windows Installer CleanUp Utility
http://support.microsoft.com/default.aspx?scid=kb;en-us;290301


b. Double click msicuu2.exe. Follow the wizard's instructions to install
the tool.
c. Launch the tool.
d. At the tool's UI, select "SQL Server 2000 Reporting Services" from the
product name listbox.
e. Click the "Remove" button and note the results.

Note: make sure that you only select "SQL Server 2000 Reporting Services"
item.

Step 2: Reinstalling RS
=============

Use the graphical setup wizard to install RS. If you use the command prompt
utility to install, you must provide information for each required
parameter. For example, you must specify the RSDATABASESERVER parameter.

Note:

1. For Standard Edition, the instance of SQL Server must be local. Check
your RS version to make sure it isn't Standard Edition.

2. Use the [/l*v log_file] parameter to specifies the name and path to a
verbose log file containing all Windows Installer log options. If you do
not specify this argument, no log file is created.

After installing, refer to the "Verifying an Installation of Reporting
Services" topic in BOL to verify RS is installed successfully.

If it cannot be installed successfully, check the verbose log file to find
related errors.

The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing.

start cmd

Solution:
rsconfig -c -s < SQLSERVERNAME > -d reportserver -a Windows -u < MYDOMAIN\MYACCOUNT > -p < PASSWORD >
or
rsconfig -c -m < REMOTECOMPUTERNAME > -s < SQLSERVERNAME > -d reportserver -a SQL -u SA -p < SAPASSWORD >

rsconfig Utility

The rsconfig utility (Rsconfig.exe) encrypts and stores connection and account values in the RSReportServer.config file. Encrypted values include report server database connection information and account values used for unattended report processing.

Configuring a Report Server Connection

After installation, you may need to modify the user name, password, and authentication mode that the report server uses to connect to the report server database. These values are encrypted. Reporting Services includes rsconfig utility that you can use to modify encrypted connection information.
Connecting to a Report Server Database

A report server must access the report server database that stores the items and metadata managed by the server. Because the report server database is a SQL Server database, you can use either Windows Authentication or SQL Server Authentication.

The connection information used to establish the connection is initially defined during setup. However, if you want to modify the connection information, or if you are moving components to different computers, you can run rsconfig to correct it.
Running rsconfig

The rsconfig utility is a console application that you run from a command line. You can run this tool on a local or remote computer to modify the connection information used by a report server instance.

When you run the utility, you specify parameters to set connection information. These parameters change the values of the connection information stored in the configuration file on the local or remote computer. You can modify the user name, password, and authentication mode used by the report server to connect to the report server database. The tool manages connection information for a single instance of the report server.

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

http://msdn2.microsoft.com/en-gb/library/aa972232(SQL.80).aspx

http://sqlforums.windowsitpro.com/web/forum/messageview.aspx?catid=92&threadid=29121&STARTPAGE=1

15 Ocak 2007 Pazartesi

ASP Net Error: Response is not available in this context

When using the response object from an aspx page, its codebehind class or a
user control, the response object is directly available because all these
derive from the page object more or less distant.

When using the response object in your own class, the object is not readily
available, but you can still access it:

HttpContext.Current.Response.Write("Hello World");

System.Threading.ThreadAbortException

try/catch bloğundan başka işleme transfer olamazsınız.
Response.redirect ,trycatch içinde kullanmamalısınız.Kullanacaksanız;
catch(Exception ex)
{
if (ex.GetType().FullName!="System.Threading.ThreadAbortException")
{
}//if
{
}//catch
Yakalanan hatanın System.Threading.ThreadAbortException olmaması gerekiyor.

System.ArgumentException: Redirect URI cannot contain newline characters.

Redirect URI cannot contain newline characters.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Redirect URI cannot contain newline characters.
.

Çözüm(Solution)in C#:
string url;
url=url.Replace("\n"," ");


İfadedeki boşlukla yerini değiştirmek.

14 Ocak 2007 Pazar

SQL Server does not exist or access denied

SQL Server does not exist or access denied Eğer böyle bir sorunla karşılaşırasanız bunun bir çok ihtimali olabilir.Ama öncellikle Sql server’ın kurulu olduğu makinanın 1433 TCP ve UDp portlarının açık(port opened) olduğuna emin olun.Sonra makinanın firewallını kapatın(firewall off) ve makinanıza bir restart(restart your machine) atın aşağıdaki connection stringi yazıp bir daha deneyin(write this);

Server=makina adı,1433;Database=veritabanı adı;user id=kullanıcı adı;password=şifre;

Birde SQl server kurulu olduğu makinada Başlangıç menusundn çalıştıra regedit yazın entera basın ver çıkan ekranda aşağıdaki dosyayı bulun ve SİLİN(erase).
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo\DSQUERY

microsoft yazısı:http://support.microsoft.com/kb/328306

ismail tutumluer

SQL SERVER 2005-SQL SERVER REPORTING SERVICES-1

SQL Server 2005 ile birlikte dahil olan ilişkili uygulamalar toplu olarak SQL Server Reporting

Service(SSRS) olarak bilinirler. SSRS,html,pdf,excel ve csv formatlarında rapor

alabilmek için gerekli tüm yönetim ve geliştirme parçalarına sahiptir. SQL

2000�da ayrı olarak internetten indirebiliyorduk fakat SQL 2005 ile birlikte

bütün parçalar paket olarak verilmektedir.Microsoft, SSRS her geçen verdiği

önemle beraber ileriki zamanlarda CrystalReports�la ilişkisini kesecek. Eğer

CrystalReport veya Microsoft Access gibi raporlama araçları kullandıysanız,

SSRS�deki sürükle bırak mantığıyla çalışan rapor oluşturmaya yarayan Report

Designer size tanıdık gelecektir. Buna ek olarak SSRS�deki Report Designer,


kullanıcıların etkili raporlama yapabilmeleri için,kendi raporlarını

oluşturmalarına olanak sağlamaktadır. Diğer SSRS özelliği ise Report

Subscriptions oluşturarak belirli zamanlarda kullanicilar raporlarını email

olarak alabilmektedir.



KURULUM


SQL Server Reporting Service,SQL Server ile birlikte gelmektedir.Reporting Service

kurmadan önce ISS (Internet Information Server)kurulu olduğuna bakınız.Eğer


kurulu değilse Error 1603 mesajı alacaksınız.Windows servislerden

DTS(Distributed Transaction Service)�in çalışır durumda olması ve Windows�un

başlangıcıyla başlaması gerekmektedir.Kurulum esnasında Components To Install

kısmında Reporting Services işaretlemeniz gerekmektedir.


001.gif


SSRS,kurulumdan sonra iki tane ISS�de site yaratacaktır,Reports ve Report Server.Reports

fiziksel olarak Reports, “C:\ Program Files \Microsoft SQL Server \MSSQL.3

\Reporting Services \ReportManager” bulunacaktır. ISS�de sanal dizinde Report

Manager adında Web uygulaması barındırmaktadır. Kurulumdan sonra //server


adı/Reports (//localhost/reports) sizi Report Manager�ın anasayfasına

yönlendirecektir.


002.jpg


Report

Manager,yaratılmış raporları görmek ,düzenlemek ve korumak için kullanılan web

tabanlı bir programdır. Report Manager, birçok özellik barındırmaktadır

bünyesinde,raporları görüntüleme,istediğiniz raporu arama veya görüntüleme,

raporların güvenliğini hangi yetkilerle kimin ne kadar müdahale edeceğini,iş

çizergesi ve Subscriptions yaratma, ad-hoc(kendi yazdığın sql query ile


oluşturduğun) raporları Report Builder çalıştırma gibi. Diğer sanal dizin olan

ReportServer,Report Manager GUI�ye gitmeden rapor istemeye yarayan bir web

servisdir.Explorer�da http query stringi parametreli gönderdiğinizde raporlar

ve raporların özellikleri istenecektir.Eğer http query stringi parametresiz

olarak gönderirseniz.Aşağıdaki ekran karşınız çıkacaktır.Ekran kısaca

raporların dizin gösterimidir.


003.gif


ReportServer ile Reports sanal dizinlerinin raporlamadaki HTTP query stringindeki gösterim farkı:


2.JPG1.JPG






KONFİGÜRASYON(Configuration)


İster kurulum esnasında isterse kurulumdan sonra konfigürasyon yapabilirsiniz.Reporting

Server�da konfigürasyon yapmamıza yardım edecek aracımız Configuration

Manager�dır.Tüm Programlar\Microsoft SQL Server 2005\Configuration

Tools\Reporting Services Configuration Manager


004.jpg


Configuration Manager ilk bağlandığınızda SSRS machine ve instance name için bilgi doğrulama

istediğinde bulunacaksınız.Eğer doğrulama gerçekleşirse karşınıza gelen ilk


ekranda “Server Status” belirecektir.Initialized “Yes” olmalı ve Service �da

çalışır durumda olmalıdır.Bir sonraki ekran “Reporting Service Virtual

Directory” ISS�de sanal alanların isimlerini değiştirmek için kullanılır.



Şifreleme Anahtarları(Encryption Keys)



Kullanıcı ve Adı, Reporting Service�de şifrelenmiştir.Bu şifrelenmiş bilgi veri

kaynağına(Data Source) veya raporlara ulaşırken kullandığınız bilgidir.Eğer


şifreleme yaptığınız anahtar bozulursa,Reporting Service duracaktır.Anahtarı bu

yüzden yedeklemeniz gerekmektedir.Aşağıdaki adımları yaptığınız zaman

anahtarlarınızı yedeklemiş olacaksınız;




  • Configuration Manager anahtarları seçiniz

  • BackUp butununa basınız.


  • Password yazınız.

  • Nereye kaydediceğinizi yazınız.



İlerde şifre zarara uğrarsa kayıt ettiğiniz yerden şifreyi geri alabilirsiniz.



BIDS




Rapor oluştururken sürükle bırak uygulamasına Business Intelligence Development

Studio(BIDS) denir.BIDS kolayca data source ve rapor oluşturmamıza izin

verir.Tüm Programlar\Microsoft SQL Server 2005\SQL Server Business Intelligence

Development Studio


ismail tutumluer

ODBC ERROR.Microsoft ODBC Sql Server driver Sql server An invalid parameter or option was specified for procedure ’sp_addextendedproperty’

ODBC ERROR.Microsoft ODBC Sql Server driver Sql server An invalid parameter or option was specified for procedure ’sp_addextendedproperty’



Bu hata arkadaşlar veritabanınızın Collation Name’nizin Turkish_CI_AS veya benzeri

dillerden
olmasından kaynaklanıyor olabilir.


11.JPG


 


Çok şık karşılaşılan bu

hatayı düzeltmenin en kolay yollarından biri veritabanınızın Collation Name’ini


SQL_Latin1_General_CP1_CI_AS olarak değiştirmeniz halinde hatayla

karşılaşmayacaksınız.Fakat veritabanınızda Türkçe karakter tutuyorsanız bu

verilere ait kolonlarınızı veri tipini nvarchar yapmanız gerekmektir.Yoksa

Türkçe karakter girdiğinizde hatayla karşılaşacaksınızdır.Collation Name

aşağıdaki TSQL koduyla düzeltebilirsiniz;


 


21.JPG




<DATABASE> yerine veritabanınız adını yazınız,





<COLLATION> yerine veritabanınız çevireceğiniz

SQL_Latin1_General_CP1_CI_AS yazınız.




Büyük ihtimal karşılaştığınız bu hattıyı düzeltecektir.




ismail h.tutumluer

Asp.Net C# ‘System.Web.HttpRequest.ServerVariables’ denotes a ‘property’ where a ‘method’ was expected

Asp.Net C# ‘System.Web.HttpRequest.ServerVariables’ denotes a ‘property’ where a ‘method’ was expected

example solution:

string strRequestMethod;
strRequestMethod =Page.Request.ServerVariables[”HTTP_REFERER”]

Son geldiğiniz sayfaya geri dönme(Return back last page or previous page)

Sayfanızın HTML tarafına içine


”>


yazınız .Geldiğiniz sayfaya 10 saniye içinde geri döneceksiniz.

ismail tutumluer