作者Phill (空瓶子)
看板Visual_Basic
标题Re: [.NET] 读取输入的字来呼叫资料表的资料列
时间Fri May 4 12:52:56 2007
※ 引述《siaujan (...)》之铭言:
恕删 假设 id name (id int
pk)
================
100 jack
101 tommy
pos=101
Sub ShowRecord(ByVal pos As Integer)
Dim objRow As DataRow
objRow = objDataSet.Tables("comicDB").Rows.Find(pos)
'id
if not (objRow
is nothing)
then
'TextBox6.Text = objRow("PW")
TextBox2.Text = objRow("name").tostring
'Get "tommy"
'TextBox3.Text = objRow("性别")
'TextBox4.Text = objRow("联络电话")
'TextBox5.Text = objRow("出生日期")
else
'not find
end if
End Sub
--
◢████
█◤By Phill 创新科技,美化人生。
█ ╭══╮═╦╦╮╭══╮╭═╦╮╔══╮╮ ╮═╦╦ ╔══╮
█ █◤ ║╰╦╦ ╠╣ ║╰╦╦╠═╬╣╠═╦╮╰╦╦╯ ╠╣ ╠╣
█◣ ◤█◤║ ╠╣ ╠╣ ║ ╠╣║ ╠╣║ ╠╣ ╠╣ ╠╣ ║╰╔╗
◥██◤ ◤ ╰═╩╯╰╩╩═╰═╩╯╰ ╰╝╚═╩╯ ╰╝ ╚╝ ╚═╩╯
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.132.147.250
※ 编辑: Phill 来自: 220.132.147.250 (05/04 12:54)
1F:推 siaujan:请问pk是什麽意思@@a 05/04 16:22
2F:推 fumizuki:Primary Key 主索引 05/04 20:06
3F:→ siaujan:哦哦 了解. 感谢~我去试试.. 05/05 00:15
4F:推 siaujan:怪 我在Access有设主索引键 可是程式compiler说没主键.. 05/05 17:27
5F:推 Phill:dim col as datacolumn 05/06 01:21
6F:→ Phill:col=objdataset.tables("XXX").columns("id") 05/06 01:22
7F:→ Phill:objdataset.tables("XXX").primarykey=col 05/06 01:24
8F:→ siaujan:唔 型别不符..上面那句有预设什麽型态吗 我主键有设int了 05/06 04:50
9F:→ siaujan:可是他跟我说无法转成int 囧 05/06 04:52
10F:推 Phill:col.DataType = System.Type.GetType("System.Int32") 试试 05/06 14:04
11F:推 siaujan:还是一样..orz 05/06 15:08