sql server - [error] Error 3154: The backup set holds a backup of a database other than the existing database

Eğer işlem yaptığın SQL Server Instance' ında açmak (Restore) için belirttiğin veritabanı adında bir veritabanı zaten varsa ve açmak istediğin veritabanından farklı bir veritabanıysa (mesela senin oluşturmadığın bir db ise ve sana sadece bak dosyası gönderilmişse) bu hatayı alırsın.

facebook app - asp.net facebook application links





css - rounded border for images

.xxx ul a img
border: 3px solid #f6b900;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;

sql server 2008 - database publishing


web service - The test form is only available for requests from the local machine





<add name=”HttpGet”/>

<add name=”HttpPost”/>





linq to sql - Type 'http://microsoft.com/wsdl/types/:char' is not declared

web service char alan içeren bir objeyi döndüremiyor.

char alanı varchar'a çevirdiğim halde, dbml'de değişmiyor. elle değiştirmek gerekiyor.
aynı şekilde wsdl'de de elle değişiklikler gerekebilir.

web service - Cannot merge schemas with targetNamespace='http://tempuri.org/'. Several mismatched declarations were found: Schema item 'complexType' named 'Page'...

Cannot merge schemas with targetNamespace='http://tempuri.org/'. Several mismatched declarations were found: Schema item 'complexType' named 'Page' from namespace 'http://tempuri.org/'.

public void Create(Page page, out string errors)
PageController controller = new PageController();
controller.Create(page, out errors);

public void Create(string title, out string errors)
PageController controller = new PageController();
var page = new Page();
page.Title = title;
controller.Create(page, out errors);

daha iyi bir çözüm:
public void Create(SerializableEntity page, out string errors)
_controller.Create(page.Entity, out errors);

Parametre olarak Page'i (yani complextype'ı) kabul etmiyor.

Not: LinqSqlSerialization.dll

web service - Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods

Step 1: Use diffrent MessageName attribute values.

public class MyWS : System.Web.Services.WebService
[WebMethod(MessageName = "GetItemById")]
public Item GetItem(int id)

[WebMethod(MessageName = "GetItemByUniqueTitle")]
public Item GetItem(string uniqueTitle)

Step 2: Set your webservice binding: ConformsTo = WsiProfiles.None

web service - linq to sql & web service

public class IntertechWS : System.Web.Services.WebService
public SerializableEntity<Page> GetPage(int id)
PageController ctrl = new PageController();
Page page = ctrl.GetPage(id);

SerializableEntity<Page> entity = new SerializableEntity<Page>(page);
return entity;

//IntertechDBDataContext db = new IntertechDBDataContext();
//var page = db.Pages.SingleOrDefault<Page, SerializableEntity<Page>>(p => p.PageID == id);
//return page;

public List<SerializableEntity<Page>> GetSubPages(int id, int langId)
PageController ctrl = new PageController();
return ctrl.GetSubPages(id, langId).ToList<Page, SerializableEntity<Page>>();

//IntertechDBDataContext db = new IntertechDBDataContext();
//var pages = db.Pages.ToList<Page, SerializableEntity<Page>>();
//return pages;

linq to sql - Make Entities Serializable (LINQ to SQL)


Code Generation Tool (SqlMetal.exe)

System.InvalidOperationException: A circular reference was detected while serializing an object of type

One of the important that things that you will likely have to do at one point or another with entity objects is serialize them. This could be for Web Services most commonly but could be for any sort of storage or transport scenario.

There are a number of pitfalls with this scenario however, primarily because LINQ to SQL will very likely generate circular references into your entity model from your data and XML Serialization will fail outright in that scenario. For example, say you have a customer and projects table and if you let LINQ generate the one to many relationship it will create Customer entity with a Projects property and a Project entity with a Customer property.

For code scenarios this is probably a good thing - you want to be able to see all Projects and filter that list in your code.

Unfortunately in a serialization scenario this doesn't work because you essentially have a circular reference - Customer ->Projects -> Customer. So we have a 1 -> Many and a 1 - 1 relationship going back to the original object here.

LINQ to SQL and Serialization

internet explorer'ın farklı sürümlerinde render görüntüleri


html - pre tag'i

images: [{ url: "images/showcase_rik_1.jpg",
description: "Imageset from flickr", link: "#" },
{ url: "images/showcase_rik_2.jpg",
description: "Just Perugia", link: "#" },
{ url: "images/showcase_rik_3.jpg",
description: "Anzio, winter sea", link: "#" },
{ url: "images/showcase_rik_4.jpg",
description: "Livorno, Piazza Grande", link: "#" },
{ url: "images/showcase_rik_5.jpg",
description: "Glacial", link: "#" }],
width: "650px",
height: "435px",
animation: { autoCycle: false },
navigator: { position: "top-left",
showNumber: true,
orientation: "vertical",
padding: "3px",
item: { cssClass: "item3",
selectedCssClass: "item3selected" } }

js - png fix


denedim, fakat işe yaramadı =/

System.NotSupportedException: An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext

System.NotSupportedException: An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported.

You may have gotten this error when using LINQ to SQL. I personally hate this error, but surprisingly enough, out of 2 years of using LINQ to SQL, this is the first time I've gotten this (2 years later, I mean). This error happens in this scenario: imagine loading up an object Order. This object has a primary key relationship Customer, which you can access via:


Under the scenes, the order class uses the EntityRef class to store the order. It's default value is default(EntityRef), which is it's default state (existing EntityRef reference, but null Customer reference within this class so no value gets assigned). Say you are accessing the customer in an order that already exists. When you do:


This reference gets loaded from the context, using the value from CustomerKey. if you assign a new value to Order.CustomerKey as in:

order.CustomerKey = 3;

The LINQ entity notices that the Customer object (underlying EntityRef _Customer variable) has already been loaded (through its HasLoadedOrAssignedValue property, or similarly named). Because you are now changing the key, this exception gets thrown because LINQ is setup not to allow you to do this. The way to change this is by doing:

order.Customer = this.DataContext.Customers.First(i => i.Key == 1);

You have to assign the reference to the Customer, and this instead updates the key, the reverse way around. I don't like this because this forces me to perform an additional data query, and in a business app this may reduce performance just to update a reference. I chose an alternate way. By adding a partial class for the order, I add a ClearCustomer method that does the following (note all LINQ types implement partial keyword, which means you can create another partial class to add additional methods).

public partial class Order ...
public void ClearCustomer()
_Customer = default(EntityRef);

And now, calling this method before changing the assignment clears the customer, and I can make the change. A bit of a hack, but it works. Unfortunately, because again the EntityRef is internal to the class, the method has to be in the class definition (can't use a static helper class to do this, at least easily). To update the reference, I can now do:

order.CustomerKey = 7;


search this blog (most likely not here)