|
I have a project with an ms access data source.
but how do i run an sql query an put the result in a textbox?
Im currentlty using:
Code Snippet
TextBox1.Text = AppdataDataSet.Tables("tblSettings").Rows(0).Item(1)
but i cant search my db in that way like i can with an sql query
thx!
|
|
|
|
|
Take a look at this article.
VB.NET Class Library: Access Table Interface
The Access Table Interface class gives you the ability to query your database with either a default or any SQL statement. The results of the SQL queries are exposed in a datatable property.
|
|
|
|
|
How can i save data from datagrid(after papulating ) without using for loop in vb.net 2005
|
|
|
|
|
You can't. The DataGrid just displays the data and lets you edit it. The data should be stored in a DataSet or DataTable, both of which expose methods for you to save the data to an XML file.
|
|
|
|
|
It depends on how you are populating the datagrid. If populating is done by adding items directly to the datagrid, the only way to save changes made in the datagrid is by looping through all of those items.
If, on the other hand, you are using a datatable as the data source for the datagrid, it is possible to save changes enmass without using a loop. For example, the Access Table Interface class extracts data from an Access database and exposes the extracted data in a datatable property. If that datatable property is set as the data source for the datagrid, all edits done in the datagrid will also be posted to the data source. The edited data can be posted back to the database with one call to the Access Table Interface's UseCommandBuilder method.
|
|
|
|
|
How do i add items and group them in a ListView?
Im using this to add a new item:
ListView1.Items.Add("ITEM1", 0)
And this for making a Group:
ListView1.Groups.Add(0, "Group1")
But how do I make "ITEM1" part of the group "Group1"
THX
|
|
|
|
|
|
thanks for your reply i downloaded the project it is in c# so im not sure if i understand it all, but i give it a try
|
|
|
|
|
Why not use the XPListView user control "as is" in your project? Just add the user control to your project and use it instead of the standard listview control. The XPListView control has two properties that makes grouping automatic ... AutoGroupMode and AutoGroupColumn.
|
|
|
|
|
again thx for your reply.
my project is build in vb.net 2005 and if i build the xplistview in vs.net 2005 i get lots of errors witch i don't know how to solve becouse i have no knowledge of c#
is it impossible to group items in the listview at runtime?
|
|
|
|
|
Yup, here is a simple example.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Add a column to the listview
ListView1.Columns.Add("Name")
' Create two groups
ListView1.Groups.Add("Group1", "Group1")
ListView1.Groups.Add("Group2", "Group2")
' Add two items and assign them to the desired group
ListView1.Items.Add("Test Group1").Group = ListView1.Groups("Group1")
ListView1.Items.Add("Test Group2").Group = ListView1.Groups("Group2")
' Add another item differently and give it a group
ListView1.Items.Add(New ListViewItem("Test Group1 again", ListView1.Groups("Group1")))
ListView1.View = View.Details
' Basically you need to know that the groups collection is where you
' add groups to the listview
' I've showed two different ways you can add an item and assign it to a group
' This should give you an idea how to work with groups
End Sub
|
|
|
|
|
|
Do you also know how to sort the items by the group name?
now when i add a group it will show the groups in the order ive added them
thanks!
|
|
|
|
|
That's interesting. I downloaded and then opened the XPListView solution in VS 2005 and the project was successfully converted from 2003 to 2005. Then I built the user control using VS 2005. There were no errors either in the conversion or the build. I added the re-built XPListView DLL to the VS 2005 Toolbox and then pasted the XPListView control onto a form in a test project. It works great and I now have the extended listview available for all of my projects.
|
|
|
|
|
can you email me your (converted) project? and the dll?
i dont understand why i got so many errors, i cant even open the form designer becouse of all the errors.
ive removed the AT for spam reasons.
svanheest gmail.com
thanks!!
|
|
|
|
|
Just letting you know that I emailed the converted XPListView DLL via an off-board email. If you don't receive it, let me know and I'll set up a download location.
|
|
|
|
|
Is there a way to run a query that is already saved on my computer and access the results without using datasets? I want to run the query, and display them in a listbox, if possible.
|
|
|
|
|
Sure, you can use a data reader to read them one line at a time, but getting a dataset and making it the data source of your listbox is easier, I would think.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is it possible to get the text from a Word document (using the Word object library in VB6) and store that text into a string variable? If so, how do you do it?
|
|
|
|
|
|
I'm doing it in VB6 through MS Access.
|
|
|
|
|
|
Hey everybody, I was hoping someone could help us upload a word document from (anywhere on the PC) into the windwordcontrol on the form. This is our first time integrating office and so our knowledge is very limited. We have gotten as far as adding the winwordcontrol to the toolbox, and adding a reference to the word object in the COM tab. I also read "Integrating Microsoft Word in your .NET applications" by Anup Shinde on the codeproject, but I dont seem to understand. Perhaps its because its in ASP syntax- or else its just me.
Can anyone help? or provide a url to another article which may help?
thanks
dazz
Dazz
|
|
|
|
|
hi
if you only want to see the word document then do the following: -
* Insert a richtextcontrol on to the form.
* use the loadfile method for richtextbox and pass the file name with full path to load it into control.
if you want to do somthing else then plz reply i will give you the solution...
with regards
Yogesh Agarwal
|
|
|
|
|
Thanks Yogesh...That worked.
Could you also tell me how we create a new word document in VB which can then be saved somewhere on the pc?
thanks again
Dazz
|
|
|
|