473,566 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convertion

shivabisoi
3 New Member
HI,

I am storing a value in database table like [0-9]{2}[a-zA-Z]{3},But My problem is that at the time of accessing this value in grid view it should be converted int NNCCC .[0-9]{2} means it convert in to NN [a-zA-Z]{3} means it convert CCC
N-Numeric,C-Character
Expand|Select|Wrap|Line Numbers
  1. Protected Sub btnButton_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnButton.ServerClick
  2.         Dim input, str As String
  3.         Dim l As Integer
  4.         Dim i, j, n As Integer
  5.         input = Text1.Value
  6.         str = ""
  7.         l = 6
  8.         While l < input.Length
  9.             j = Integer.Parse(input.Substring(l, 1))
  10.             For i = l - 5 To l - 3
  11.                 If input.Substring(i, 3) = "0-9" Then
  12.                     For n = 0 To j - 1
  13.                         str = str & "N"
  14.                     Next
  15.                 ElseIf input.Substring(i, 3) = "A-Z" Then
  16.                     For n = 0 To j - 1
  17.                         str = str & "C"
  18.                     Next
  19.                 End If
  20.  
  21.             Next
  22.             l = l + 8
  23.         End While
  24.         Text2.Value = str
  25.     End Sub


This code is working on Two text box Text1 and Text2.When I Enter value in Text1 i get output on Text2.But My problem is that How can i get value from database and display in gridview.
Apr 14 '10 #1
2 894
MrMancunian
569 Recognized Expert Contributor
So? What do you want from us then? Do you already have code? Is there even a question?

Steven
Apr 14 '10 #2
Frinavale
9,735 Recognized Expert Moderator Expert
A GridView will display the data that it is bound to.
You need to retrieve the data from the database first before you can bind the GridView to anything.

Please review the following article that outline how to use a database:
Database tutorial Part 1
Database tutorial Part 2[/quote]

-Frinny
Apr 14 '10 #3

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

Similar topics

1
2174
by: Petr Studenovsky | last post by:
Hello I made small GUI test program in Visual Basic NET for SQL communication. I need some help with these problems. problem 1) If I change some settings in datagrid from properties window (e.g. background color). my datatest is removed. I compared it with diff program and it reorganized all source code.
0
1392
by: Konstantin Kivi | last post by:
I have problems getting character set convertion to work in 4.1.4 gamma under linux. Can sombody point me to the online recource other than standard MySQL doc so that I get more information.
6
2229
by: Chiller | last post by:
I'm in the process of writing a class that performs functions on a Distance object. The object is created by entering details as "Distance a (5, km)" or "Distance b (3, cm)" etc. I wish to write a function that I can call to "as required by comparison functions" to convert any value to a mm value so that when I'm comparing Distance objects...
1
1618
by: Vidar | last post by:
I have a problem in dotNET XSL convertion object. (XMLTRANSFORM) It won't convert UTF-8 to ISO-8859-1 I use this stylesheet for konvertion: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- For convertion from UTF-8 to ISO-8859-1 CaracterSet --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
0
324
by: McKoy | last post by:
Hi, I'm translating some code from C++ to C#, but I don't know how to change the code below to get it working under C# ...., I've tried explicity convertion, but without any results :( Please help.... int b = -1; uint a,c = 0; Encoding encodingAscii = Encoding.GetEncoding(1250);
4
2092
by: juli | last post by:
Good afternoon! I have an error while trying to convert to DateTime ,here is the code and the error: ArrayList al = new ArrayList(); temp_str=Line.Split(' '); al.Add(temp_str); // value="11/02/2004" al.Add(temp_str); // value="10:53:10" temp_str2=(string)al.ToArray(typeof(string));
8
3176
by: juli | last post by:
I am trying to convert an object of a class which is derived from collectionbase class.It's not working: while ((line = file.ReadLine()) != null && line.IndexOf(" ")!=-1) { al.Add(line); } string exc_string = (string)al.ToArray(typeof(string));
0
1414
by: isore | last post by:
Convertion php to asp.net : PB lecture fichier .ini URGENT URGENT URGENT URGENT URGENT URGENT J'ai un code en php (http://parisports.free.fr) mais le client veut le même en asp.net J'ai converti le php en asp avec la moulinette windows http://81.56.65.81 J'y connais rien mais la bibliotheque de lecture du fichier d'echange (fichier.ini)...
4
2240
by: kaikai | last post by:
Hi, I've got a problem while trying to make my source code clean. In a template: template<typename T> class A { public: T data; };
24
9020
by: ChaosKCW | last post by:
Hi I am reading from an oracle database using cx_Oracle. I am writing to a SQLite database using apsw. The oracle database is returning utf-8 characters for euopean item names, ie special charcaters from an ASCII perspective. I get the following error: > SQLiteCur.execute(sql, row)
0
7666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5213
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
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 we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.