openFileDialog1.Filter = @"文本文件|*.txt|所有文件|*.*"
if (openFileDialog1.ShowDialog() ==DialogResult.OK)
{
StreamReader sr = new StreamReader(openFileDialog1.FileName, System.Text.Encoding.Default)
richtextbox1.Text = sr.ReadToEnd()
sr.Close()
}
然后,单击按钮打开将会d出一个打开对话框,找到你要打开文件的路径,点击打开即可
#include <stdio.h>exec sql include sqlca
int main(){
exec sql begin declare section
char userpasswd[30]="openlab/123456"
struct{
int id
char name[30]
double salary
}emp
exec sql end declare section
exec sql connect:userpasswd
exec sql declare empcursor cursor for
select id,first_name,salary from
s_emp order by salary
exec sql open empcursor
exec sql whenever notfound do break
for(){
exec sql fetch empcursor into :emp
printf("%d:%s:%lf\n",emp.id,emp.name,
emp.salary)
}
exec sql close empcursor
exec sql commit work release
}
把数据存到结构体里。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)