我试图将文本设置为标签Label_caller.Text = phone_number
,我收到此错误:"System.InvalidOperationException:跨线程操作无效:控件'Label_caller'从其创建的线程以外的线程访问." 我该如何克服这个问题?我如何使用关键字Me?
我有字符串数组列表:
"1A", "12A", "12B", "6", "A", "5B", "B", "13"
.
如果我这样做,myList.Sort();
那么我得到:
"1A", "12A", "12B", "13", "5B", "6", "A", "B"
.
但我需要的是先按照前面的数字排序,然后按字母排序:
"1A", "5B", "6", "12A", "12B", "13", "A", "B"
.
我可以用
public class CustomComparer : IComparer
{
Comparer _comparer = new Comparer(System.Globalization.CultureInfo.CurrentCulture);
public int Compare(object x, object y)
{
// Convert string comparisons to int
return _comparer.Compare(Convert.ToInt32(x), Convert.ToInt32(y));
}
}
Run Code Online (Sandbox Code Playgroud)
但它抛出异常.我如何得到我需要的东西?
在Oracle我有:
SELECT t2.Regkood, t2.naitatel, t2.naitafaks, t3.lahtiolekuaeg, t1.*
FROM table1 t1, table2 t2, table3 t3
WHERE t1.client = t2.client AND t1.client = t3.client(+) AND t1.client = 414246
Run Code Online (Sandbox Code Playgroud)
如何在SQL Server中获得相同的内容?
谢谢
我正在使用此代码来获取数据:
Dim connetionString As String
Dim connection As SqlConnection
Dim sqlq As String
sqlq = "select top 1 * from table1 where smth"
Dim ds As New DataSet
connetionString = "Data Source=db;Initial Catalog=ic;User ID=id;Password=pass"
connection = New SqlConnection(connetionString)
Try
Using connection
Dim command As SqlCommand = New SqlCommand(sqlq, connection)
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
If reader.HasRows Then
Do While reader.Read()
x = reader.GetString(5)
Loop
End If
reader.Close()
End Using
Catch ex As Exception
End Try
Run Code Online (Sandbox Code Playgroud)
这种类型的连接(与不同的sqlq [查询])我在diffenrent函数中使用了很多,每次我关闭连接.我想优化它,以便获取数据所需的时间更少.我怎么做?
如何使用带有HTML正文的MAPI发送邮件?我需要在消息正文中创建表。我正在使用vb6和MAPI控件。有任何想法吗?
Function MailSend(sSendTo As String, sSubject As String, sText As String) As Boolean
On Error GoTo ErrHandler
With MAPISession1
If .SessionID = 0 Then
.DownLoadMail = False
.LogonUI = True
.SignOn
.NewSession = True
MAPIMessages1.SessionID = .SessionID
End If
End With
With MAPIMessages1
.Compose
.RecipAddress = sSendTo
.AddressResolveUI = True
.ResolveName
.MsgSubject = sSubject
.MsgNoteText = sText
.Send False
End With
MailSend = True
Exit Function
ErrHandler:
'MsgBox Err.Description
MailSend = False
End Function
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Jira REST API 包含组件来创建问题。我正在发布此 JSON,但我得到远程服务器返回错误:(400) 错误请求。
问题是:-没有组件就没有错误,但是当组件有问题时。有什么帮助吗?JSON:
{
"fields": {
"project": {
"key": "keyGoesHere"
},
"assignee": {
"name": "name.surname"
},
"component": {
"name": "someName"
},
"summary": "test2",
"description": "test2",
"issuetype": {
"name": "Task"
}
}
}
Run Code Online (Sandbox Code Playgroud) vb.net ×2
api ×1
bad-request ×1
c# ×1
components ×1
html ×1
jira ×1
label ×1
mapi ×1
oracle ×1
outer-join ×1
select ×1
sorting ×1
sql ×1
sql-server ×1
text ×1
vb6 ×1