473,480 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how can i convert integer to string

2 New Member
I have a school project and I need to convert sasia(quantity),cmimi(price) to string...can anyone help me please?
Expand|Select|Wrap|Line Numbers
  1. Public Sub executeyourquery(ByVal query As String)
  2.         Dim cmd As New SqlCommand(query, con)
  3.         cmd.Parameters.AddWithValue("@produkt_id", txtID.Text)
  4.         cmd.Parameters.AddWithValue("@emertimi", txtEmertimi.Text)
  5.         cmd.Parameters.AddWithValue("@sasia", txtSasia.Text)
  6.         cmd.Parameters.AddWithValue("@cmimi", txtCmimi.Text)
  7.         cmd.Parameters.AddWithValue("@vlera", txtVlera.Text)
  8.         cmd.Parameters.AddWithValue("@furnitor_id", txtF.Text)
  9.         con.Open()
  10.         cmd.ExecuteNonQuery()
  11.         con.Close()
  12.     End Sub
Mar 5 '18 #1
2 2086
Frinavale
9,735 Recognized Expert Moderator Expert
What error are you getting?

Assuming your txtSasia is a TextBox, then txtSasia.Text is already a string.

Do you want to convert that into an Integer?
Use the Integer.TryParse Method...
Expand|Select|Wrap|Line Numbers
  1. Dim sasiaInt As Integer
  2. Integer.TryParse(txtSasia.Text, sasiaInt )
  3. cmd.Parameters.AddWithValue("@sasia", sasiaInt)
  4. Dim cmimiInt As Integer
  5. Integer.TryParse(txtCmimi.Text, cmimiInt )
  6. cmd.Parameters.AddWithValue("@cmimi", cmimiInt )
Mar 5 '18 #2
Erjola
2 New Member
Thanks Frinavale
i had forgot .Text ...Now its ok
Mar 5 '18 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
39769
by: Hector A | last post by:
Hi I'm trying to convert a string that already looks like a date to a date that I can use when I pass it from java to the database. I receive the date in format yyyy-mm-dd and I need it to be a...
5
15139
by: KB | last post by:
Hi, This may be a rudimentary question: How to convert a string like '777' to an octal integer like 0777, so that it can be used in os.chmod('myfile',0777)? I know the leading zero is...
2
119261
by: lizayica | last post by:
How to convert a string like '2,3,4' to three integer 2,3,4 in SQL procedure of DB2 UDB 8.2? Thanks!
3
10231
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
7
13860
by: henrytcy | last post by:
Hi, How can I convert integer, for example 12113, to char array but without specify an array size in C programming? Thanks!
13
3621
by: coinjo | last post by:
Is there any function to determine the length of an integer string?
3
9168
by: priyanka | last post by:
Hi there, I want to convert a String into integer. I get the string from a file using : string argNum; getline(inputStream,argNum); I now need to convert argNum into integer.
3
2740
by: palani12kumar | last post by:
hi. I want to get a string as input. If the input is an integer i want to save it to an int variable. I know to convert a number to int. but how to convert a string to number(integer). in C++
9
6911
by: vaskar | last post by:
I have got one problem in VB.NET 2005 using unicode I want to add two numbers in vb.net 2005 through UNICODE I didn't know how to convert UNICODE string to integer. I hope you can solve my...
4
2240
by: mthread | last post by:
Hi, I would like to know the method to convert integer to string. Thanx in advance.
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.