小编ar.*_*gin的帖子

如何查找与SQL Server相关的所有触发器?

我在SQL Server中为表创建了一个触发器,它对我有用.

我的问题是:如何找到并修改它?

我使用此查询来查找我的触发器:

select * from sys.triggers
Run Code Online (Sandbox Code Playgroud)

这可以找到所有触发器,但是如何打开它并更改触发器?

sql-server sql-server-2008

44
推荐指数
5
解决办法
17万
查看次数

为什么HttpContext.Current为null?

我有一个在所有应用程序中使用的值; 我在application_start中设置了它

  void Application_Start(object sender, EventArgs e)
  {
    Dictionary<int, IList<string>> Panels = new Dictionary<int, IList<string>>();
    List<clsPanelSetting> setting = clsPanelSettingFactory.GetAll();
    foreach (clsPanelSetting panel in setting)
    {
        Panels.Add(panel.AdminId, new List<string>() { panel.Phone,panel.UserName,panel.Password});
    }
    Application["Setting"] = Panels;

    SmsSchedule we = new SmsSchedule();
    we.Run();

  }
Run Code Online (Sandbox Code Playgroud)

并在SmsSchedule

public class SmsSchedule : ISchedule
{
    public void Run()
    {           
        DateTimeOffset startTime = DateBuilder.FutureDate(2, IntervalUnit.Second);
        IJobDetail job = JobBuilder.Create<SmsJob>()
            .WithIdentity("job1")
            .Build();

        ITrigger trigger = TriggerBuilder.Create()
             .WithIdentity("trigger1")
             .StartAt(startTime)
             .WithSimpleSchedule(x => x.WithIntervalInSeconds(60).RepeatForever())
             .Build();

        ISchedulerFactory sf = new StdSchedulerFactory();
        IScheduler sc …
Run Code Online (Sandbox Code Playgroud)

c# asp.net iis httpcontext

42
推荐指数
3
解决办法
9万
查看次数

错误:远程服务器返回错误:(401)未经授权

我想得到互联网的图片并插入到单词中.

我用这个代码.

MainDocumentPart mainPart = wordprocessingDocument.MainDocumentPart;
System.Net.WebRequest request = 
    System.Net.HttpWebRequest.Create("http://spsdev2:1009");

System.Net.WebResponse response = request.GetResponse();
ImagePart imagePart = mainPart.AddImagePart(ImagePartType.Jpeg);
//Send an HTTP request and get the image at the URL as an HTTP response
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(fileName);
WebResponse myResp = myReq.GetResponse();

//Get a stream from the webresponse
Stream stream = myResp.GetResponseStream();
Run Code Online (Sandbox Code Playgroud)

我在myReq.GetResponse()中收到错误;

错误:远程服务器返回错误:(401)未经授权.

编辑

这段代码对我有用:)

myReq.UseDefaultCredentials = true;

myReq.PreAuthenticate = true;

myReq.Credentials = CredentialCache.DefaultCredentials;
Run Code Online (Sandbox Code Playgroud)

asp.net sharepoint sharepoint-2010

22
推荐指数
2
解决办法
8万
查看次数

将ListView的SelectedItem绑定到ViewModel

我有一个列表视图,在viewmodel中绑定项目与属性.

<ListView Height="238" 
          HorizontalAlignment="Left" 
          Name="listView" 
          VerticalAlignment="Top" 
          Width="503"
          ItemsSource="{Binding BusinessCollection}"
          SelectionMode="Multiple">
    <ListView.View>
        <GridView>
            <GridView.Columns>
                <GridViewColumn>
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <CheckBox  IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListViewItem}}, Path=IsSelected}" />  
                       </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
                <GridViewColumn DisplayMemberBinding="{Binding ID}" Header="ID" />
                <GridViewColumn DisplayMemberBinding="{Binding Name}" Header="Name" />
            </GridView.Columns>
        </GridView>
    </ListView.View>
</ListView>
Run Code Online (Sandbox Code Playgroud)

并在viewmodel中.

ICollectionView _businessCollection

public ICollectionView BusinessCollection
{
    get { return _businessCollection; }
    set {
          _businessCollection = value;
          RaisePropertyOnChange("BusinessCollection");
        }
}
Run Code Online (Sandbox Code Playgroud)

如何在viewmodel中获取businesscollection的选定项?

c# wpf mvvm

11
推荐指数
1
解决办法
1万
查看次数

如何暂停Threading.timer来完成一个函数

可能重复:
同步计时器以防止重叠

Threading.Timer我班上有一个.

 System.Threading.Timer timer;
 TimerCallback cb = new TimerCallback(ProcessTimerEvent);
 timer = new Timer(cb, reset, 1000, Convert.ToInt64(this.Interval.TotalSeconds));
Run Code Online (Sandbox Code Playgroud)

并为它定义了一个回调.

private void ProcessTimerEvent(object obj)
{
  if(value)
    MyFunction();
}
Run Code Online (Sandbox Code Playgroud)

运行它时,在myfunction完成之前重新运行回调.

如何暂停Threading.Timer完成myfunction

.net c# wpf

8
推荐指数
2
解决办法
7988
查看次数

如何将ImageSource转换为Byte数组?

我使用 LeadTools 进行扫描。

我想将扫描图像转换为字节。

void twainSession_AcquirePage(object sender, TwainAcquirePageEventArgs e)
 {
   ScanImage = e.Image.Clone();
   ImageSource source = RasterImageConverter.ConvertToSource(ScanImage, ConvertToSourceOptions.None);
 }
Run Code Online (Sandbox Code Playgroud)

如何将ImageSource转换为Byte数组?

c# wpf leadtools-sdk

8
推荐指数
2
解决办法
2万
查看次数

如何停止FluentScheduler的任务?

我正在使用FluentScheduler,并有一个注册表类,

public class UnreadAlertRegistry : Registry
{
  public UnreadAlertRegistry(int minute, string user, bool? type)
    {

        var alertAction = new Action(() =>
          {
            // show message box 
          }
       Schedule(alertAction).ToRunEvery(minute).Minutes();
     }
  }
Run Code Online (Sandbox Code Playgroud)

在应用程序中,我初始化它.

alert = new UnreadAlertRegistry(5, _dashboardUser, false);
TaskManager.Initialize(alert);
Run Code Online (Sandbox Code Playgroud)

它每5分钟运行一次.

我想阻止这个.我如何停止此调度程序?

c# wpf scheduler fluentscheduler

6
推荐指数
1
解决办法
3130
查看次数

如何在javascript中启用/禁用linkbutton?

我在页面上有一个链接按钮.

<asp:LinkButton ID="edit" runat="server" OnClick="edit_Click" Enabled="False">??????</asp:LinkButton>
Run Code Online (Sandbox Code Playgroud)

我想在javascript中启用/禁用此功能.

我使用此代码但设置可见

var objedit = document.getElementById('<%= edit.ClientID.ToString() %>');
objedit.style.display = "none";
Run Code Online (Sandbox Code Playgroud)

我使用此代码但未启用

if (count == 1) {
    objedit.disabled = false;
} else {
    objedit.disabled = true;
}
Run Code Online (Sandbox Code Playgroud)

我可以点击但链接按钮是禁用的.

在此输入图像描述

javascript asp.net

5
推荐指数
1
解决办法
1万
查看次数

什么是"__cdecl"?

我想将AES算法与MPI一起使用.

我用visual c ++编写代码.当我编译代码时,我收到此错误:

函数_main中引用的未解析的外部符号"void __cdecl BTM(int,int)"(?BTM @@ YAXHH @ Z)

c++ visual-c++

5
推荐指数
1
解决办法
3916
查看次数

将 VSTO 加载项部署到所有用户

我添加了一个Word 2013 Add-In将功能区添加到 word的项目。

我释放它。它为当前用户添加了功能区到 word,但我想将它添加到所有用户。

我在 Windows 中设置了注册表。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\General\
Run Code Online (Sandbox Code Playgroud)

设置EnableLocalMachineVSTO=1它。

但不要将其添加到所有用户。

c# wpf vsto visual-studio-2012 office-2013

5
推荐指数
1
解决办法
7771
查看次数