如何格式化由 0 和所需值组成的总共 10 次加热的字符串结果
how to format a string result consisting of 10 heats in total with 0 and the desired value
我必须将查询结果插入十个字符(数字)的字符串中。这些值必须全部为 0,我只需要将最后一个字符替换为查询单元格的字符。
我的代码:
Dim idClienteCosarConsorziati As New DataSet
idClienteCosarConsorziati = DB_SQL.OpenDataset("SELECT Anagrafica.ID_cliente FROM Anagrafica WHERE (((Anagrafica.ID_gruppo) Is Null) AND ((Anagrafica.ID_padre_consorzio)=13584))", "Anagrafica.ID_cliente")
Try
Dim contenitore As DataTable = idClienteCosarConsorziati.Tables(0)
For Each row As DataRow In contenitore.Rows
For Each cells As String In row.ItemArray
Dim stringtoserach As String = "E:\PDF_Fatture\" + Format(cells, "0000000000")
Next
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
我尝试使用 Format(cells, "0000000000")
但结果没有 0
我必须将查询结果插入十个字符(数字)的字符串中。这些值必须全部为 0,我只需要将最后一个字符替换为查询单元格的字符。
我的代码:
Dim idClienteCosarConsorziati As New DataSet
idClienteCosarConsorziati = DB_SQL.OpenDataset("SELECT Anagrafica.ID_cliente FROM Anagrafica WHERE (((Anagrafica.ID_gruppo) Is Null) AND ((Anagrafica.ID_padre_consorzio)=13584))", "Anagrafica.ID_cliente")
Try
Dim contenitore As DataTable = idClienteCosarConsorziati.Tables(0)
For Each row As DataRow In contenitore.Rows
For Each cells As String In row.ItemArray
Dim stringtoserach As String = "E:\PDF_Fatture\" + Format(cells, "0000000000")
Next
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
我尝试使用 Format(cells, "0000000000")
但结果没有 0