|登录 |注册

123
返回列表 发新帖
楼主: 绿病毒
打印 上一主题 下一主题

visual basic 2008 query data from mysql

[复制链接]
weeming21
2010-5-23 09:06 PM
老掉= =
话说 LAMP 是什么? 是 PHP 还是什么?? 能够说明下吗?
宅男-兜着走 发表于 2010-5-23 08:37 PM


LAMP = Linux + Apache + Mysql + Php
绿病毒
2010-5-23 09:47 PM

            Dim strCommand As String
            strCommand = "Insert into registerform(id,username,, password, phoneno) values ('" & Me.idtext.Text & "','" & Me.usernametext.Text & "', '" & Me.passwordtext.Text & "', '" & Me.phonenotext.Text & "')"
            Try
                Dim cm As New SqlClient.SqlCommand(strCommand)
                con.Open()
                cm.ExecuteNonQuery()
                MsgBox("Succesfully saved…")
            Catch ex As Exception
                MessageBox.Show(ex.Message, "Error")
            Finally
                If con.State = ConnectionState.Open Then
                    con.Close()
                End If
            End Try
        End Sub


请问下我这个Coding出了什么问题?
不好意识本人完全没有基本的基础在做着project
老师是完全没教我们家要我们用这些东西作了所以麻烦你们来纠正我
宅男-兜着走
2010-5-23 10:33 PM
Dim strCommand As String
        strCommand = "Insert into registerform(id,username,, pas ...
绿病毒 发表于 2010-5-23 09:47 PM



这样谁得空帮你看==
至少 Exception 贴 来看看。
绿病毒
2010-5-23 11:23 PM
sorry 怎样Exception啊??
宅男-兜着走
2010-5-23 11:50 PM
回复 24# 绿病毒

Error 讯息。
绿病毒
2010-5-24 12:38 AM
error message
<<the cnnectionString property has not been initialized>>
宅男-兜着走
2010-5-24 02:05 AM
本帖最后由 宅男-兜着走 于 2010-5-24 02:14 AM 编辑
error message
绿病毒 发表于 2010-5-24 12:38 AM


这位同学, 老师没教你怎么写 code, 但是不会连Database的常识都不会不教你吧??
你的 Error 很明显的是 Connection string 还没输入。 如果你没告诉你的程式去哪里一个 Database 拿资料, 他又要怎么知道呢??
http://www.connectionstrings.com/mysql

  1. Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
复制代码

  1. con.Open()
复制代码
还有你的 con ? 请问你的 con 在那里一个部分宣告了?? 我好像没看到。

  1. "Insert into registerform(id,username,, password, phoneno) values ('" & Me.idtext.Text & "','" & Me.usernametext.Text & "', '" & Me.passwordtext.Text & "', '" & Me.phonenotext.Text & "')"
复制代码
Query 语句多了个 逗号, 后面的不懂有没有错。
宅男-兜着走
2010-5-24 02:08 AM
LAMP = Linux + Apache + Mysql + Php
weeming21 发表于 2010-5-23 09:06 PM



    == 。。。。 不怪得。 谢谢你的教导, 我终于知道人家所谓的 Lame , 就是 LAMP 了==
绿病毒
2010-5-24 02:28 AM
haiz我老师所来话长啦!有教的话我就不会麻烦大家了

可是我的serve我有连了!!我没放出来罢了!!练了还是不能哦怎么办?
Super-Tomato
2010-5-24 08:44 AM
haiz我老师所来话长啦!有教的话我就不会麻烦大家了

可是我的serve我有连了!!我没放出来罢了!!练了还是不能哦怎么办?
绿病毒 发表于 2010-5-24 02:28 AM


要真這樣的話,那麼你可以到某些网站看到你大批的同學都在問問題了吧
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2026-1-1 11:51 AM , Processed in 0.114507 second(s), 20 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部