Monday, October 26, 2009
Creating an insertion from a Table with Select
Thursday, October 15, 2009
droping all connections with sql server
USE master
go
DECLARE @dbname sysname
SET @dbname = 'name of database you want to drop connections from'
DECLARE @spid int
SELECT @spid = min(spid) from master.dbo.sysprocesses where dbid = db_id(@dbname)
WHILE @spid IS NOT NULL
BEGIN
EXECUTE ('KILL ' + @spid)
SELECT @spid = min(spid) from master.dbo.sysprocesses where dbid = db_id(@dbname) AND spid > @spid
END
If you want to drop all the connections to a database immediately
USE master
GO
ALTER DATABASE database name
SET OFFLINE WITH ROLLBACK IMMEDIATE
ALTER DATABASE database name
SET ONLINE
or if you are in a hurry there is an option that says"drop all database connections" as a checkbox in the window displayed for the detach task and you just check it and does close the connections.
Tuesday, October 13, 2009
NO JOINS IN ORACLE
This is what it says in Oracle site. So that's the end point of it. Here are the examples
Using Join Queries: Examples The following examples show various ways of joining tables in a query. In the first example, an equijoin returns the name and job of each employee and the number and name of the department in which the employee works:
SELECT last_name, job_id, departments.department_id, department_name
FROM employees, departments
WHERE employees.department_id = departments.department_id
ORDER BY last_name;
Using Self Joins: Example The following query uses a self join to return the name of each employee along with the name of the employee's manager. A WHERE
clause is added to shorten the output.
SELECT e1.last_name||' works for '||e2.last_name
"Employees and Their Managers"
FROM employees e1, employees e2
WHERE e1.manager_id = e2.employee_id
AND e1.last_name LIKE 'R%';
for more info go to : http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2066611
Examples taked from the site.
System Provider
If you are using asp.net 1.1 then go to your machine.config file and in process model section try to chnage user name as "system";
if you are in 2.0 version do the same thing some times you might not find the process model section at all then try add the same section it self.
you can find out the machine.config file in the following location:for 2.0 version i think u are using 2.0
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
System. Debug
Oracle 10g with C# & asp.net
Tools to be used for the test.
- Oracle 10g Express.
- Visual Studio.Net
Thursday, October 8, 2009
Response to Grid backcolor in Row With Ajax
on a different way:
|
on the server side:
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
var radAjaxManager = RadAjaxManager.GetCurrent(Page);
radAjaxManager.ClientEvents.OnResponseEnd = "gridRowColor";
}
Friday, October 2, 2009
Anthroposophy
Taked from wikipedia.
Thursday, October 1, 2009
Linq with Outer Join, Ternary and orderby with linq
join rc in db.RefCycles on lfp.CycleId equals rc.CycleId
into JoinedRc
from rc in JoinedRc.DefaultIfEmpty()
join rf in db.RefFrequencies on lfp.Frequency equals rf.FrequencyId
orderby lfp.LogFundingId descending
select new
{
lfp.LogFundingId,
lfp.LogActionId,
lfp.FundingId,
lfp.FundingCode,
lfp.InstrumentCode,
LogActionDescription = lfp.RefLogAction.Description,
lfp.ApplicableDate,
lfp.Description,
rf.Frequency,
lfp.RollOverDay,
CycleDesc = lfp.CycleId != null ? rc.CycleDesc : "",
lfp.CCY,
lfp.CycleId,
lfp.IsConfirmed,
lfp.LastUser,
lfp.LastModified
};
as you can see the CycleDesc comes with a empty string if the CycleId doesn't bring a value since can be null.