|
public class CuponsFormas<T> : CollectionBase where T : IXmlItem
|
|
|
|
|
Hi All,
I have written a class that creates a dynamic SSIS package using C#, all is fine and dandy with this, it correctly creates and executes the package and the data plops into the SQL database as expected.
The problem is that I now need to 'tag on' another static package to be executed at the end of this dynamic package. If you were writing the SSIS package you would do this with an 'Execute Package Task' in the BIDS UI but I need to do this in a web service using C# code.
I can't actually find anything on Google or Code Project that deals with this scenario, any links or ideas would be great.
Thanks,
|
|
|
|
|
Just thought I'd answer this since I've fingured it out now.
I ended up adding a ExecuteProcess task instead.
1. Add a reference to Microsoft.SqlServer.ExecProcTask
2. Add in code:
MyTask2 = package.Executables.Add("STOCK:ExecuteProcessTask");
TaskHost th = MyTask2 as TaskHost;
th.Properties["Description"].SetValue(th, "<PackageName>");
th.Properties["Executable"].SetValue(th,"DTEXEC.exe");
th.Properties["Arguments"].SetValue(th, "<Your Arguments>");
PrecedenceConstraint pcFileTasks = package.PrecedenceConstraints.Add((Executable)MyTask1, (Executable)MyTask2);
pcFileTasks.Value = DTSExecResult.Success;
|
|
|
|
|
Hi all..
I have created a dll in c# for crawling the documents from sharepoint and to get the modified date,created Date..etc..
When i run it from server where sharepoint is installed its getting the created date and modified Date....
But when i run it from client pc...It is giving Debug Error....
when i comment this code....which i used for getting created date and modified date...
the code is
using (SPSite RootSite = new SPSite(listPath))
{
Console.WriteLine("1Entered SPSIte path");
using (SPWeb SiteCollection = RootSite.OpenWeb())
{
string path = listPath;
SPFile file = SiteCollection.GetFile(path);
string TimeCreated = file.TimeCreated.ToLongDateString();
Console.WriteLine("1.1: Created Date is :" + TimeCreated);
}
}
when i comment this code it works fine....is there any problem in it...but the same code works fine in server pc...I am totally confused..please give some idea......I am totally new to sharepoint and c#
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
I want to show the SQL code of an SP in my program. Can I call any sys.procedure to get the code from a SP-name?
_____________________________
...and justice for all
|
|
|
|
|
This should do the trick:
EXEC sp_helptext '<stored procedure>'
Regards,
Rob Philpott.
|
|
|
|
|
Rob Philpott wrote: should do the trick
Yes, it should.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Following Query will give you the result in a single string
SELECT [text] FROM sysobjects so INNER JOIN syscomments sc ON so.id = sc.id
WHERE [name] = '<sp name="">'
|
|
|
|
|
Hi,
I have set the timer1.enabled = true
and timer1.interval = 10000 --> represents 10 seconds
It seems the timer tick event does not get fired in windows service.
I have tried placing other timers and they seem to have the same issue.
When I use the timers on a form, they seem to work fine.
Question:
Is there anything I should do inside the windows service so that the tick event of the timer is fired?
Thanks
|
|
|
|
|
It works for me:
using System;
using System.Timers;
namespace ConsoleApplication2
{
internal class Program
{
private static void Main(string[] args)
{
Timer timer = new Timer();
timer.Interval = 10000;
timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
timer.Enabled = true;
Console.Read();
}
private static void timer_Elapsed(object sender, ElapsedEventArgs e)
{
Console.WriteLine("Tick...!!!");
}
}
}
|
|
|
|
|
Do you use this in a windows service?
|
|
|
|
|
I am using a timer inside a Windows Service with no problem. I do use the Timer Start() and Stop() methods, but I would expect that enabling and disabling would work just fine. Have you checked the event viewer to ensure there are no errors being generated by the service that might explain this problem?
|
|
|
|
|
|
When I run the following code in Release mode, it tells me line 11, which is one too high. When I run it in Debug mode, I get the correct line number 10. Why?
using System;
using System.Diagnostics;
namespace Debugging
{
class Program
{
static void Main(string[] args)
{
ShowDebugInfo();
Console.ReadKey();
}
private static void ShowDebugInfo()
{
StackFrame here = new StackFrame(1, true);
Console.WriteLine(here.GetMethod().Name);
Console.WriteLine(here.GetFileLineNumber().ToString());
}
}
}
|
|
|
|
|
No, I don't have a clue why it does that. According to the documentation info like line numbers should only be available in debug builds so maybe its just random nonsense.
Regards,
Rob Philpott.
|
|
|
|
|
It's by design, your code was optimized in Release build. Turn off optimization in Release, and it will work. (but then you pretty much have the same as Debug).
|
|
|
|
|
Hi all,
Any one please tell what is the use and advantage of DTO also give me some URL where i can learn how to use DTO, Connecting DTO with my table
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
What does this have to do with C#?
Please post your specific C# issue.
|
|
|
|
|
I want to get conditional formatting range if an excel sheet
for eg, if conditional formatting are set in an excel sheet in
cell range
a1 - b10
and
b25- c99
then , i want to get both this range and their corresponding conditional formatting condition , how can i get that
please help me
|
|
|
|
|
|
Hi,
I'm building a program which needs to load some data from a SQL server when it loads.
I've been trying to make a pretty loading screen while the program loads but have been running into a strange occurance.
Here is my code:
<br />
Thread loadingThread;<br />
loadingThread = new Thread(delegate()<br />
{<br />
Application.Run(new LoadingWindow()); <br />
});<br />
loadingThread.Start();<br />
<br />
Thread.Sleep(10000);
<br />
loadingThread.Abort();<br />
The code seems to work ok, except that when the loading thread is aborted the loading window doesn't disappear. When I run my mouse cursor over it (or click somewhere) however it does.
Does anyone know how I could fix this so that when the loading is completed, the loading window disappears correctly?
Cheers,
|
|
|
|
|
because u are not closing the form,
u can also use
this.BeginInvoke(" Delegate which loads your window");
'
'
Do some Stuff
'
'
'
'
'
this.BeginInvoke(" Delegate which close your window");
|
|
|
|
|
When you abort the thread, you kill the message pump that handles the messages that does everything in the GUI. There is nothing that can handle the message that says that the window should be removed.
Generally, using the Abort method is a bad way to stop a thread. The Abort method kills the thread by throwing a ThreadAbortException in it, which can happen anywhere in the thread's code. It's difficult to write code that can cope with that situation in a well behaved manner.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guffa,
Thanks for you reply, I'm getting really stuck on this.
I've been trying to do what the guy above suggested with little success, here's where I'm at right now.
<br />
Form2 loadForm;<br />
<br />
private delegate void TestDelegate();<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
<br />
Thread t = new Thread(delegate() { <br />
this.loadForm = new Form2(); <br />
});<br />
t.Start();<br />
<br />
this.BeginInvoke(new TestDelegate(Openform));<br />
<br />
Thread.Sleep(4000);
<br />
this.BeginInvoke(new TestDelegate(Closeform));<br />
<br />
t.Abort();<br />
}<br />
<br />
private void Openform()<br />
{<br />
this.loadForm.ShowDialog();<br />
}<br />
<br />
private void Closeform()<br />
{<br />
this.loadForm.Dispose();<br />
}<br />
This isnt even compiling at moment (Error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.), so I'm getting pretty anoyed with the whole threading thing.
How else can you close a thread without calling Abort? Can you spot where i'm screwing up here?
Im trying to:
1. Create a (non-visible) window in thread 1
2. Show a loading window in thread 2 (form 2)
3. Do some loading in thread 1
4. Close the loading window in thread 2
5. Show the window in thread 1
Thanks heaps,
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
private delegate void TestDelegate();
Form2 loadForm;
public Form1()
{
InitializeComponent();
loadForm = new loadForm();
Thread t=new Thread(start1);
t.Start();
}
private void Openform()
{
loadForm.ShowDialog();
}
private void Closeform()
{
loadForm.Dispose();
}
private void start1()
{
this.BeginInvoke(new TestDelegate(Openform));
Thread.Sleep(2000); // do stuff in main thread
this.BeginInvoke(new TestDelegate(Closeform));
}
}
}
//Try this one
|
|
|
|