16,020,840 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by anand4886 (Top 13 by date)
anand4886
16-Apr-12 14:55pm
View
i want to add data in sql server table from vb.net application,my code block is
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlConnection
Public Class Form1
Dim cn As SqlConnection
Dim ConStr As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ConStr = "Data Source=ANAND-PC\SQLEXPRESS;Initial Catalog=anand;User ID=;Password="
cn = New SqlConnection(ConStr)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cmd As New SqlClient.SqlCommand
Dim query As String
query = "Insert Into anand1 (roll) values (" & TextBox1.Text & ");"
cmd.CommandText = query
cmd.CommandType = CommandType.Text
cmd.Connection = cn
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
End Sub
End Class
it is showing some error in cn.open
pls help its very urgent
anand4886
16-Apr-12 5:52am
View
pls tell me how can i open sql management studio editor
anand4886
15-Apr-12 11:05am
View
i have installed the sql server but unable to open the sql management studio
anand4886
4-Apr-12 14:37pm
View
Dim cmd As New MySqlCommand
cmd .CommandText = "Insert Into try (Name) values ("Simon")"
cmd.CommandType = CommandType.Text
cmd.Connection = cn
cn.Open()
cmd.ExecuteNonQuery()
cn.Close()
but in cmd.commondtext line .net is showing an error that "end of statement expected",pls correct my code
anand4886
31-Mar-12 7:25am
View
when i select add refrence than a dialog box appears and it contains .net,com,project,browse,recent,which opttion should i search or select
anand4886
31-Mar-12 7:17am
View
how can i add refrence ,it is showing some error
anand4886
31-Mar-12 6:55am
View
i know insert code,pls tell me abt connection string
anand4886
31-Mar-12 6:50am
View
i have done this with access but i want to do this with mysql
anand4886
31-Mar-12 6:48am
View
i want to insert data in the table from vb.net
anand4886
3-May-11 4:45am
View
i have two table named purchase,payment
purchase's fields are party amount
payments fields are party payment
how can i create report using both table's data in vb.net
i m using access2007
anand4886
2-May-11 6:15am
View
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
Dim i, c As Integer
Dim a, b As string
i = ListView1.Items.Count - 1
While i >= 0
a = ListView1.Items.Item(i).Text
b = ListView1.Items.Item(i).SubItems.Item(1).Text
c = ListView1.Items.Item(i).SubItems.Item(2).Text
Dim QUERY As String
QUERY = " INSERT INTO stockinhand(stockcode,stocknamename,quantity)VALUES('a','b',c)"
EXECUTEQUERY(QUERY)
MsgBox("saved")
End While
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
anand4886
2-May-11 5:50am
View
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
Dim i, c As Integer
Dim a, b As Integer
i = ListView1.Items.Count - 1
While i >= 0
a = ListView1.Items.Item(i).Text
b = ListView1.Items.Item(i).SubItems.Item(1).Text
c = ListView1.Items.Item(i).SubItems.Item(2).Text
Dim QUERY As String
QUERY = " INSERT INTO stockinhand(stockcode,stocknamename,quantity)VALUES('a','b',c)"
EXECUTEQUERY(QUERY)
MsgBox("saved")
End While
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
anand4886
2-May-11 5:49am
View
sir if one of variable is string then how can i write query pls tell me?
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Try
Dim i, c As Integer
Dim a, b As string
i = ListView1.Items.Count - 1
While i >= 0
a = ListView1.Items.Item(i).Text
b = ListView1.Items.Item(i).SubItems.Item(1).Text
c = ListView1.Items.Item(i).SubItems.Item(2).Text
Dim QUERY As String
QUERY = " INSERT INTO stockinhand(stockcode,stocknamename,quantity)VALUES('a','b',c)"
EXECUTEQUERY(QUERY)
MsgBox("saved")
End While
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
Show More