I have this code, I need see in textbox.text all my information, how I do that
Function Consultas(ByVal usuario As String) As System.Data.Dat aSet
Dim connectionStrin g As String = "server='Sistem as'; user id='sa';
password=''; database='Siste mas'"
Dim dbConnection As System.Data.IDb Connection = New
System.Data.Sql Client.SqlConne ction(connectio nString)
Dim queryString As String = "SELECT [ImvenrtarioComp usSQL].* FROM
[ImvenrtarioComp usSQL] WHERE ([ImvenrtarioCo"& _
"mpusSQL].[Usuario] = @Usuario)"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Sql Client.SqlComma nd
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dbParam_usuario As System.Data.IDa taParameter = New
System.Data.Sql Client.SqlParam eter
dbParam_usuario .ParameterName = "@Usuario"
dbParam_usuario .Value = usuario
dbParam_usuario .DbType = System.Data.DbT ype.String
dbCommand.Param eters.Add(dbPar am_usuario)
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Sql Client.SqlDataA dapter
dataAdapter.Sel ectCommand = dbCommand
Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet
dataAdapter.Fil l(dataSet)
Return dataSet 3 2236
So access dataSet.Tables[0] and iterate over the Rows property and get the
data you need/want. Once you have that data, you can put it into a TextBox.
I'm not sure exactly what you want, but here's a sample that might help:
foreach (DataRow row in dataSet.Tables[0])
{
string val = (string)row["MyStringColumn "];
MyTextBox.Text += val + Environment.New Line; // append this in my multiline
TextBox
}
-Brock
DevelopMentor http://staff.develop.com/ballen I have this code, I need see in textbox.text all my information, how I do that
Function Consultas(ByVal usuario As String) As System.Data.Dat aSet Dim connectionStrin g As String = "server='Sistem as'; user id='sa'; password=''; database='Siste mas'" Dim dbConnection As System.Data.IDb Connection = New System.Data.Sql Client.SqlConne ction(connectio nString) Dim queryString As String = "SELECT [ImvenrtarioComp usSQL].* FROM [ImvenrtarioComp usSQL] WHERE ([ImvenrtarioCo"& _ "mpusSQL].[Usuario] = @Usuario)" Dim dbCommand As System.Data.IDb Command = New System.Data.Sql Client.SqlComma nd dbCommand.Comma ndText = queryString dbCommand.Conne ction = dbConnection Dim dbParam_usuario As System.Data.IDa taParameter = New System.Data.Sql Client.SqlParam eter dbParam_usuario .ParameterName = "@Usuario" dbParam_usuario .Value = usuario dbParam_usuario .DbType = System.Data.DbT ype.String dbCommand.Param eters.Add(dbPar am_usuario) Dim dataAdapter As System.Data.IDb DataAdapter = New System.Data.Sql Client.SqlDataA dapter dataAdapter.Sel ectCommand = dbCommand Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet dataAdapter.Fil l(dataSet) Return dataSet
I nedd to put in textbox1.text=u suario. textbox2.text=i p etc. using the code
below, thank for you answer.
"Brock Allen" wrote: So access dataSet.Tables[0] and iterate over the Rows property and get the data you need/want. Once you have that data, you can put it into a TextBox. I'm not sure exactly what you want, but here's a sample that might help:
foreach (DataRow row in dataSet.Tables[0]) { string val = (string)row["MyStringColumn "]; MyTextBox.Text += val + Environment.New Line; // append this in my multiline TextBox }
-Brock DevelopMentor http://staff.develop.com/ballen I have this code, I need see in textbox.text all my information, how I do that
Function Consultas(ByVal usuario As String) As System.Data.Dat aSet Dim connectionStrin g As String = "server='Sistem as'; user id='sa'; password=''; database='Siste mas'" Dim dbConnection As System.Data.IDb Connection = New System.Data.Sql Client.SqlConne ction(connectio nString) Dim queryString As String = "SELECT [ImvenrtarioComp usSQL].* FROM [ImvenrtarioComp usSQL] WHERE ([ImvenrtarioCo"& _ "mpusSQL].[Usuario] = @Usuario)" Dim dbCommand As System.Data.IDb Command = New System.Data.Sql Client.SqlComma nd dbCommand.Comma ndText = queryString dbCommand.Conne ction = dbConnection Dim dbParam_usuario As System.Data.IDa taParameter = New System.Data.Sql Client.SqlParam eter dbParam_usuario .ParameterName = "@Usuario" dbParam_usuario .Value = usuario dbParam_usuario .DbType = System.Data.DbT ype.String dbCommand.Param eters.Add(dbPar am_usuario) Dim dataAdapter As System.Data.IDb DataAdapter = New System.Data.Sql Client.SqlDataA dapter dataAdapter.Sel ectCommand = dbCommand Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet dataAdapter.Fil l(dataSet) Return dataSet
I ned to put textbox1.text=u suario, textbox2,text=i p, etc. thank for you
answer.
"Brock Allen" wrote: So access dataSet.Tables[0] and iterate over the Rows property and get the data you need/want. Once you have that data, you can put it into a TextBox. I'm not sure exactly what you want, but here's a sample that might help:
foreach (DataRow row in dataSet.Tables[0]) { string val = (string)row["MyStringColumn "]; MyTextBox.Text += val + Environment.New Line; // append this in my multiline TextBox }
-Brock DevelopMentor http://staff.develop.com/ballen I have this code, I need see in textbox.text all my information, how I do that
Function Consultas(ByVal usuario As String) As System.Data.Dat aSet Dim connectionStrin g As String = "server='Sistem as'; user id='sa'; password=''; database='Siste mas'" Dim dbConnection As System.Data.IDb Connection = New System.Data.Sql Client.SqlConne ction(connectio nString) Dim queryString As String = "SELECT [ImvenrtarioComp usSQL].* FROM [ImvenrtarioComp usSQL] WHERE ([ImvenrtarioCo"& _ "mpusSQL].[Usuario] = @Usuario)" Dim dbCommand As System.Data.IDb Command = New System.Data.Sql Client.SqlComma nd dbCommand.Comma ndText = queryString dbCommand.Conne ction = dbConnection Dim dbParam_usuario As System.Data.IDa taParameter = New System.Data.Sql Client.SqlParam eter dbParam_usuario .ParameterName = "@Usuario" dbParam_usuario .Value = usuario dbParam_usuario .DbType = System.Data.DbT ype.String dbCommand.Param eters.Add(dbPar am_usuario) Dim dataAdapter As System.Data.IDb DataAdapter = New System.Data.Sql Client.SqlDataA dapter dataAdapter.Sel ectCommand = dbCommand Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet dataAdapter.Fil l(dataSet) Return dataSet This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Phill |
last post by:
I thought when you tabbed into a textbox that the text it contained
was automatically highlighted. This use to be the default in win32.
Is there an easy way to do this in .NET. I don't want this to happen
if the mouse is used to select the TextBox.
Seems wierd, If the Textbox has the default text in it the higlight
works but not if you edit it.
Thanks.
|
by: Mad Scientist Jr |
last post by:
I'm stuck trying to work with a HTML <SELECT> control and javascript
(similar to DualList but that control doesn't offer enough options to
totally control the text on the buttons and control, also I don't have
c# on this machine to try and modify it).. anyway...
I'm trying to get javascipt to select all items in a <SELECT> control
and submit the form to an asp.net page. For some reason when the link
is clicked, you can see the items all...
|
by: Cindy M -WordMVP- |
last post by:
Hi all
While working my way through a VB.NET exercise, I came
across something that didn't do what the text said it
should and I'm wondering if it's supposed to behave this
way, or not (and why).
txtNote.Text = "the text"
txtNote.Enabled = True
'txtNote.Select()
|
by: Brett |
last post by:
I have a textbox with a heigth of 384. I put a lot of text into it and must
scroll down to see it all. When I do Ctrl + A, it doesn't highlight all of
the text. I have to manually drag my mouse to get the text. Is there a way
to engage the select all?
Thanks,
Brett
|
by: abc my vclass |
last post by:
My win-form have many numericupdown controls to applied. But numericupdown
control don't like textbox, text box control can automatic selected text
when got focus. Is there any method can let me set all numericupdown
autoselect text when gotfocus?
| |
by: cj |
last post by:
I asked this question a couple of days ago but am just now looking at it
again.
I used to use the textbox gotfoucs event to have all the text in the
textbox selected when it gotfocus. That doesn't seem to work in .net
when the textbox receives focus via a mouse click.
Jeffrey and Shane both advised how to get a mouse click to select all
the text (thank you both) but using the mousedown or mouseup events
doesn't work the way I want it...
|
by: Dabbler |
last post by:
Is there a way to mark the text in a TextBox control as selected so when the
user types a new value the existing text is replaced?
Thanks
|
by: Brano |
last post by:
Hi I am using vb.net 2005 this is a windows application
I am using this functionality in another project I have created this
simple project to show the problem
Basically I have two forms:
Form1 - contains a panel (System.Windows.Forms.Panel)
|
by: PinkBishop |
last post by:
I am using VS 2005 with a formview control trying to insert a record
to my access db. The data is submitted to the main table no problem,
but I need to carry the catID to the bridge table CatalogImage where
imgID also needs to be placed.
Below is my code behind to carry the catID using the Select @@Identity
and insert imgID to the bridge table.
No data is being entered into the bridge table.
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |