Click here to Skip to main content
15,909,953 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
jacklynn_mei29-Jul-07 20:39
jacklynn_mei29-Jul-07 20:39 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
Edwin Syarief29-Jul-07 21:20
Edwin Syarief29-Jul-07 21:20 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
jacklynn_mei29-Jul-07 21:45
jacklynn_mei29-Jul-07 21:45 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
Edwin Syarief29-Jul-07 22:04
Edwin Syarief29-Jul-07 22:04 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
jacklynn_mei29-Jul-07 22:20
jacklynn_mei29-Jul-07 22:20 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
Edwin Syarief29-Jul-07 22:26
Edwin Syarief29-Jul-07 22:26 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
jacklynn_mei29-Jul-07 22:40
jacklynn_mei29-Jul-07 22:40 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
jacklynn_mei29-Jul-07 22:43
jacklynn_mei29-Jul-07 22:43 
then after i have read about the trigger..I do like this (will call AIClass at the main class):

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Server;
using System.Data;
using System.Data.SqlClient;

namespace AIClass
{
public class AICheck
{
[SqlTrigger(Event = "FOR INSERT", Name = "AITrigger", Target = "AIEvent")]

public static void checkUserRole()
{
//if (!SqlContext.IsAvailable)
//{
// Console.Write("Context none");
// Console.Read();
//}
//else
//{
SqlTriggerContext tgContext = SqlContext.TriggerContext;
SqlConnection conn = new SqlConnection("Data Source=DIMENSION3000\\SQLEXPRESS; Initial Catalog=AITania; User Id=sa; Password=123456");
using ( conn = new SqlConnection("context connection=true"))
{
conn.Open();
//SqlCommand cmd = conn.CreateCommand();
SqlDataReader reader;
//cmd.ExecuteNonQuery();
string msg = "";

if (tgContext.TriggerAction == TriggerAction.Insert)
{

SqlCommand sqlComm = new SqlCommand("SELECT * FROM INSERTED",conn);
//cmd.CommandText = "SELECT * FROM INSERTED";
SqlContext.Pipe.ExecuteAndSend(sqlComm);

//reader = cmd.ExecuteReader();
//sqlComm.Connection = conn;
//sqlComm.CommandText = "SELECT * FROM INSERTED";

//for (int x = 0; x < tgContext.ColumnCount; ++x)
//{
// msg += string.Format("Column {0} {1} been updated{2}", x, (tgContext.IsUpdatedColumn(x) ? "has" : "has not"), Environment.NewLine);
//}
for (int i = 0; i < reader.FieldCount; i++)
{
msg = msg + reader.GetName(i) + ":" + (string)reader[i] + " ";
}
} conn.Close();
}
//}

}
}
}
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
Edwin Syarief29-Jul-07 22:53
Edwin Syarief29-Jul-07 22:53 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
jacklynn_mei29-Jul-07 23:09
jacklynn_mei29-Jul-07 23:09 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
Edwin Syarief29-Jul-07 23:17
Edwin Syarief29-Jul-07 23:17 
GeneralRe: how to do the sqlClr connection & deploy it in c# Express Edition? Pin
jacklynn_mei29-Jul-07 23:27
jacklynn_mei29-Jul-07 23:27 
QuestionConnecting password protected MS Access database from C# Pin
Nadia Monalisa29-Jul-07 15:30
Nadia Monalisa29-Jul-07 15:30 
AnswerRe: Connecting password protected MS Access database from C# Pin
Luis Alonso Ramos29-Jul-07 16:12
Luis Alonso Ramos29-Jul-07 16:12 
GeneralRe: Connecting password protected MS Access database from C# Pin
Nadia Monalisa29-Jul-07 16:17
Nadia Monalisa29-Jul-07 16:17 
AnswerRe: Connecting password protected MS Access database from C# Pin
Paul Conrad29-Jul-07 16:57
professionalPaul Conrad29-Jul-07 16:57 
QuestionC# console application Pin
Saamir29-Jul-07 13:26
Saamir29-Jul-07 13:26 
AnswerRe: C# console application Pin
Luc Pattyn29-Jul-07 13:43
sitebuilderLuc Pattyn29-Jul-07 13:43 
AnswerRe: C# console application Pin
Christian Graus29-Jul-07 13:44
protectorChristian Graus29-Jul-07 13:44 
AnswerRe: C# console application Pin
Paul Conrad29-Jul-07 17:12
professionalPaul Conrad29-Jul-07 17:12 
QuestionInteracting with Exchange Server 2003? Pin
wbjohnson29-Jul-07 13:12
wbjohnson29-Jul-07 13:12 
AnswerRe: Interacting with Exchange Server 2003? Pin
ekynox29-Jul-07 20:46
ekynox29-Jul-07 20:46 
QuestionSimulate Serial Port Pin
Erosares229-Jul-07 12:38
Erosares229-Jul-07 12:38 
AnswerRe: Simulate Serial Port Pin
Luc Pattyn29-Jul-07 13:00
sitebuilderLuc Pattyn29-Jul-07 13:00 
GeneralRe: Simulate Serial Port Pin
vikas amin24-Jul-08 11:41
vikas amin24-Jul-08 11:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.