visual c ++中的mysql连接 [英] mysql connection in visual c++

查看:90
本文介绍了visual c ++中的mysql连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string^ constring=L"datasource=localhost;port:80;username=root;password='';";
MySqlConnection^ conDatabase=gcnew MySqlConnection(constring);
MySqlCommand^ cmd=gcnew MySqlCommand("select * from eventor.user",conDatabase);
MySqlDataReader^ myreader;
try
{
conDatabase->Open();
myreader=cmd->ExecuteReader();
}
 catch(Exception^ ex)
{
 MessageBox::Show(ex->Message);
 }



在串口和字符串中存在问题



1> c:\\ \\ users\sony\documents\visual studio 2010 \projects\student database\student database\Form1.h(134):error C2065:'string':未声明的标识符

1> c:\ users \ sony \documents \ visual studio 2010 \projects \student database \student database \Form1.h(134):error C2065:'constring':undeclared identifier

1> c:\ usersrs \ sony \documents\visual studio 2010 \projects \student database \student database\Form1.h(135):error C2065:'constring':未声明的标识符





帮助我


there is a problem in th constring and string

1>c:\users\sony\documents\visual studio 2010\projects\student database\student database\Form1.h(134): error C2065: 'string' : undeclared identifier
1>c:\users\sony\documents\visual studio 2010\projects\student database\student database\Form1.h(134): error C2065: 'constring' : undeclared identifier
1>c:\users\sony\documents\visual studio 2010\projects\student database\student database\Form1.h(135): error C2065: 'constring' : undeclared identifier


help me

推荐答案

应该 string 不能使用大写字母S - 字符串 [ ^ ]。
Should string not be with a capital S - String[^].


这篇关于visual c ++中的mysql连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆