|
You don't. The device you want to talk to has to have drivers that exposes it AS a COM port. USB really has nothing to do with it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Check if the USB device you want to use already acts as a com port. My "USB GPS" work as a COM thru a USB port, I was lucky. If not, you can buy a USB to COM port adapter. That also works for me on an other device I use.
Hope this helps.
Rob
|
|
|
|
|
i'm really enjoying the simplicity in how to pull data in vb.net 2005
i've got a data source (pointing to an access db),
i throw a few controls in my form, i open that cute database designer
add my query which selects various fields from a table WHERE (ID=?)
and voila, i can pull data in my program.
but now i don't want to get data "where id = ?" only, but i want "where id = ? or id = ? or ..."
so i tried "WHERE (?)" but u arent allowed to pass sql code, only parameters. (obvious)
in other words i want to be able to easily execute my own sql statement.
does anyone know the easiest, least painful way to do this ?
(that is without going into connecting to the database, declaring a gazzilion things just to execute 1 line of sql, and pass them back to a datatable type)
-- modified at 8:10 Tuesday 19th December, 2006
|
|
|
|
|
ad3z wrote: i'm really enjoying the simplicity in how to pull data in vb.net 2005
i've got a data source (pointing to an access db),
i throw a few controls in my form, i open that cute database designer
add my query which selects various fields from a table WHERE (ID=?)
and voila, i can pull data in my program.
That's nice and all, but the "wizards" make it a large PITA to support the resulting code. If you want TOTAL control over the database code and develop a good understanding of how it all works and fits together, it's a good idea to scrap the wizard generated stuff and write it by hand.
ad3z wrote: but now i don't want to get data "where id = ?" only, but i want "where id = ? or id = ? or ..."
so i tried "WHERE (?)" but u arent allowed to pass sql code, only parameters. (obvious)
Now you know why I said what I did. If you search your code for the query you put into the wizard, you can usually modify the query string to what you want. The problem is that you are now adding multiple parameters to the query string and will have to modify more code to add those parameters.
ad3z wrote: does anyone know the easiest, least painful way to do this ?
Scrap it and write it from scratch.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I don't think the code is exact for an access database, but if it where sql, as a part of your data connection you apply the member variable.
<br />
Dim Sql1 As String<br />
<br />
sSql1 = " Select * where id like '%'"<br />
<br />
'connection<br />
"osql -S " & [Server] & " -d " & [database] & " -U [User] -P [Password] " & "-Q """ & sSql1 & """" & " -n -o """ <br />
|
|
|
|
|
well i manage to connect to it but it's alot of code, and
it looks like i set up another connection (apart from the one i'm activly using with
the .net components)
i have to declare oledb connection strings
connect to it (add the fact it's got security blah)
read it to a dataset
specify my sql command
execute the command into a new dataset
and then use datatables and datarows to access it
isn't there a simpler way ?
that what i'm looking for
(something in the lines of the new ado.net help thingys)
Ericos Georgiades
|
|
|
|
|
Trying using the datagrid control. After you follow the wizard setting up the connection you have the option of changing your query. You can also add additional queries with buttons to run the specific query.
|
|
|
|
|
"the specific query"
yeah i dont want to run pre-defined queries cause i cannot specify my criteria freely.
i want to return to a table all the rows of a table
given a selection of parameters
for instance, if a listbox shows me all the customers and i select 4 of them, i'd like to
have a table as datatable which has the rows of the sales table which match the 4 customers i chose.
with the wizard i can only predefine the criteria
anyways it doesnt seem as though there is a simpler way rather than writing the entire connection string
oh yeah and i know, i talk alot... :P
Ericos Georgiades
|
|
|
|
|
I want to read data from USB IR receving device.
|
|
|
|
|
Then it's probably exposed as a COM port (Serial port). You'll have to check with any documentation you got with the device or the machine. Google for "VB.NET Serial Port" and you'll come up with all kinds of stuff on it, that's IF it's exposed as a serial device.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Keep your posts in the same thread. Don't start a new thread just because you have something need to say about the old one.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Whay I dont have the "system.io.ports" class in vb.net?
-- modified at 2:38 Tuesday 19th December, 2006
|
|
|
|
|
agbaria ahmed wrote: Whay I dont have the "system.io.ports" class in vb.net?
Which version of .NET are you using.
System.IO.Ports is only supported in .NET 2.0 and .NET 3.0
|
|
|
|
|
|
Hi,
Can you Help me.
I am having one multiline textbox.i am selecting some content from word document and paste it in textbox.the data is being inserted into database when button is clicked.The problem is the data is not inserting along with html tags.
And when i retrive the data into datagrid the htmlformat is not there i.e without line breaks,spaces..etc...
vin1070
|
|
|
|
|
A textbox does not support formatting. Perhaps you should use a RichTextBox instead.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Thanks for quick reply
but there is limitation for me, i have to use only multiline textbox and if i am not wrong there is no Richtextbox in .Net webapplication and i dont want to buy any third party tool either.
regards,
vin1070.
|
|
|
|
|
Hi Friends,
Today, i required one small project which i need to submit on my univesity.i required souce code of the project also.
project in VB ok, Small c++ it's also okay... I want to submit this project but tommrrow onyl... this is my humble request you to pls so the needful..
I already submited project but, my they cancle for some resion. request you yo send me as soon as possible. i want to take printout hardcopy also..pls do the needful
RAHUL
|
|
|
|
|
I understand that its urgent but you failed to say what the project is and what it should do. We need to know this.
Posted by The ANZAC
|
|
|
|
|
No we don't. He needs to write it himself. He can come here and ask questions, but we're not going to write it for him just to save his butt.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: ask questions, but we're not going to write it for him just to save his butt
Yep. If I were his teacher and found this thread, well.......
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
PaulC1972 wrote: Yep. If I were his teacher and found this thread, well.......
Ahh yes, the imagination abounds with retribution!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: the imagination abounds with retribution
Oh yeah, you got it
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|
|
you aren't making much sence
|
|
|
|
|
Perhaps you should do you own course work, and not expect others to do it for you. I am sure we do not mind helping but I hope nobody is going to help you cheat !!!!
Steve Jowett
|
|
|
|