For work i recently had to use ASP.Net Dynamic Data. Pretty easy to generate some editforms for the various database entities. Late at night at home i tried to do the same, but unfortunately the templates were missing in Visual Studio 2008 (still not using 2010......). After googling around i came across this post where was stated that (re)installing visual studio 2008 SP1 would sovle the problem, it surely helped for me!
http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=27673c47-b3b5-4c67-bd99-84e525b5ce61&displayLang=en
Just download the ISO file, unpack (i use WinRAR) or mount it with your favorite disc mounter (Deamon tools for example). After the install my templates were back!!
Have fun
Saturday, July 24, 2010
Tuesday, June 15, 2010
WCF Services and IIS Hosting
Recently i ran into some problems with publishing a WCF Service to an IIS host. Looked like there were more then one hostheaders defined in IIS, and on only one our service is running.
By adding some code into the system.serviceModel section of the web.config the problem is solved.
By adding some code into the system.serviceModel section of the web.config the problem is solved.
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://www.yourwebsitehere.nl"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
Friday, June 11, 2010
regex vs contains
regex vs contains
http://blogs.msdn.com/b/natbr/archive/2010/06/03/which-is-faster-regex-ismatch-or-string-contains.aspx
http://blogs.msdn.com/b/natbr/archive/2010/06/03/which-is-faster-regex-ismatch-or-string-contains.aspx
Tuesday, June 8, 2010
WCF Error, time related?
An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
http://briannoyes.net/2009/07/23/ObscureWCFExceptionNdashMislaidBlame.aspx
http://briannoyes.net/2009/07/23/ObscureWCFExceptionNdashMislaidBlame.aspx
Tuesday, June 1, 2010
WCF Hosted in IIS cannot access a SQL Server
WCF Hosted in IIS cannot access a SQL Server. Looks like a WCF Webservice that is hosted in IIS makes a remote connection to a SQL Server, while it looks like it is a local connection.
http://social.msdn.microsoft.com/forums/en-US/wcf/thread/2fdc2490-f29d-41df-bc47-1ff848871996
Probably i have to set the TCP connection to enabled, and allow it through the firewall. To configure SQL Server for various protocols see this link:
http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/
http://social.msdn.microsoft.com/forums/en-US/wcf/thread/2fdc2490-f29d-41df-bc47-1ff848871996
Probably i have to set the TCP connection to enabled, and allow it through the firewall. To configure SQL Server for various protocols see this link:
http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/
Friday, May 28, 2010
Need to rebuild ALL indexes in a database?
Need to rebuild ALL indexes in a database? Recently i used the script below.
set nocount on
set nocount on
declare @totcnt int
, @rowcnt int
, @nsql nvarchar(max)
declare @sql_statements table (
Id int identity(1, 1)
, SqlStatement nvarchar(max)
)
insert
into @sql_statements
select 'alter index ' + i.name + ' on ' + object_name(i.object_id) + ' rebuild '
from sys.indexes i
set @totcnt = @@rowcount
set @rowcnt = 1
while @rowcnt <= @totcntbegin
select @nsql = SqlStatement from @sql_statements where Id = @rowcnt
exec sp_executesql @nsql set @rowcnt = @rowcnt + 1 endFor this script i was sure that i had to rebuild them, in stead of reorganizing them. I will post some tips about the usage of rebuilding vs reorganizing anytime soon
Thursday, May 27, 2010
Execute a query on ALL databases? sp_MsForEachDB might do the trick!
Ever wanted to execute a query on ALL databases available on 1 server?
sp_msforeachdb @command1 = '
select *
from [?].sys.database_files
order by name'
the question mark will be replaced with the database name, so generating some SQL for each DB that exists will be easy. I used this one to shrink some large transaction logs
if object_id('##tmp_sqlstatements') is not null
begin
drop table ##tmp_sqlstatements
end
create table ##tmp_sqlstatements (
Id int identity(1, 1)
, SqlStatement nvarchar(max)
)
go
sp_msforeachdb @command1 = '
insert
into ##tmp_sqlstatements
select ''use [?];
dbcc shrinkfile('''''' + name + '''''')''
from [?].sys.database_files
where type_desc = ''log''
order by name'
declare @totrow int
, @currow int
, @nsql nvarchar(max)
select @totrow = count(Id)
, @currow = 1
from ##tmp_sqlstatements
while @currow <= @totrow
begin
select @nsql = SqlStatement
from ##tmp_sqlstatements
where Id = @currow
exec sp_executesql @nsql
set @currow = @currow + 1
end
drop table ##tmp_sqlstatements
It executes all the statements at once, so it can be used as a part of a maintenance plan. If creating more disk space is the issue for executing this script, make sure that you put the recovery mode into simple. But of course only when you don't need the transaction logs!!
This is very easy to do :
select replace('alter database [[NAME]] set recovery simple ', '[NAME]', name)
from sys.databases
where recovery_model_desc = 'full'
order by name
This will give a result of SQL statements to execute.
Subscribe to:
Posts (Atom)