小编Cha*_*ack的帖子

T-SQL(varchar(max)vs CLR(string,SqlString,SqlChars)?

我有一个问题,我无法解决.我正在使用SQL Server 2005,C#CLR来使用外部dll.问题在于参数的长度.我需要使用函数参数类型varchar(max).如果在C#代码,我使用string,SqlSring我不能使用T-SQL类型varchar(max),刚刚varchar(4000)nvarchar(4000).我需要说的是,当我需要使用超过4000个符号时,可能会出现这种情况,所以我需要知道,我需要使用哪种C#类型varchar(max).

我已经阅读了很多文章,其中有几篇说,为此,我可以使用SqlChars.但!我有字符串操作.我如何使用stringSqlString然后转换为SqlChars?(有可能SqlChars.ToString()SqlChars.ToSqlString()).

我没有找到任何C#代码.

c# t-sql types sql-server-2005 sqlclr

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

C#/Excel:使用正确的数据类型将 Excel 范围转换为数组

我用 Excel 应用程序 ( Microsoft.Office.Interop.Excel)打开了 *.htm 文件。解析得真好!所以我可以使用它。为了提高速度,我试图从 Excel 范围获取数据并插入 System.Array 并使用它:

Excel.Range range = ExcelWorksheet.get_Range("A1", "H1500"); // get all values
System.Array dataArray = (System.Array)(range.Cells.Value2); // insert into array
Run Code Online (Sandbox Code Playgroud)

问题在于数据类型。如果 Excel 单元格具有时间或日期格式,则range.Cells.Value2使:
12.06.2012 至 41072(Excel 单元格类型 - 日期)
14:48 至 0,6166666666666667(Excel 单元格类型 - 时间)
如果我从 Excel 单元格中获得单值,我得到正确的值(与Cells.Text.ToString()):

ExcelWorksheet.get_Range("A1", "A1").Cells.Text.ToString()
Run Code Online (Sandbox Code Playgroud)

任务:我需要从 Excel Sheet 中获取值,就像文本一样,而不是另一种类型。
并且不希望 Excel 代替我思考 :)

c# excel excel-interop

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

同步调用多个“测量”操作

我必须借助measure()函数来测量多个值。
因为是异步操作,我只能写:

this.refContainerView.measure((x, y, width, height, pageX, pageY) => {
  const containerViewHeight = height

  this.refCommentList.measure((x, y, width, height, pageX, pageY) => {
    const commentListOffset = pageY
    const commentListHeight = height

  // do something

  })
})
Run Code Online (Sandbox Code Playgroud)

如果需要测量更多的组件,它看起来就像一个回调地狱。
是否可以同步编写代码,例如在await或其他的帮助下,例如:

const contaierView = this.refContainerView.measure()
const commentList = this.refCommentList.measure()

// and then do something with 
contaierView {x, y, width, height, pageX, pageY}
commentList  {x, y, width, height, pageX, pageY}
Run Code Online (Sandbox Code Playgroud)

measure react-native

3
推荐指数
1
解决办法
733
查看次数