誰かが明示的にintをSqlInt32に変換する方法を知っていますか?コンパイラは変換エラーをスローします。SqlInt32への明示的変換int
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial class UserDefinedFunctions
{
[SqlFunction()]
static public int RarFiles(SqlString TARGET, SqlString SRC, SqlString SIZE)
{
ProcessStartInfo p = new ProcessStartInfo();
p.FileName = @"C:\Program Files\WinRAR\rar.exe";
p.Arguments = String.Format("a -cfg- -ep1 -idcdp -m5 -r -s -v{0} {1} {2}", SIZE, TARGET, SRC);
Process x = Process.Start(p);
SqlInt32 res = x.ExitCode;
return res;
}
}
問題が 'int'を' SqlInt32'に変換していて、 return文で次の行に? – Dirk
私はそれを取得しません。 メソッドの結果は 'int'で、' x.ExitCode'は 'int'です。なぜ最初に 'SqlInt32'に変換するのですか? –