|
Hi!
I have installed an 'old and rusted' version of Visual Studio 2003, with comes with base .NET Framework 1. I have some questions...
Can I install and use .Net Framework 2 and 3 with Visual Studio 2003? What files do I have to dounload and install? Just the standard 'redistributable packs'?
Can all of tree been simultaneously installed?
Do I have to use some directive or somehow config Visual Studio to use one or other version? Or all thre convive / overlap simultaneously?
What will I have access to? I supponse classes, controls, funcionalities (like Generics)? Will some new controls appear automatically on my toolbar, or I will have to manually regiser?
Sorry for so many inquiries... and thanks in advance for your replies!
|
|
|
|
|
VS 2003 supported only the .NET Framework 1.1. Although you can install other versions of the framework side by side, you can't use them in VS2003.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello,
I would like to ask how can I do a search with filter
in vb 2008 or a sample code will be appreciated. The database connection that I am using is ms access and the connection
I used to connect my program
is OLEDB connection. Any reply will be kindly appreciated.
Thanks,
dfan23
|
|
|
|
|
Since you are searching values in the database, queries would be doing the actual work. Now, the basic query would be:
Select columnNames from tableName
Now, when someone applies a filter, the query you would need to create would be like:
Select columnNames from tableName where someColumn in (selcted values)
Now, it depends on the way you are creating the query. You would need to update the code where you create the query or the stored procedure which does the search to include the selected filter in the where clause.
"No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem
|
|
|
|
|
Hello,
Thanks for immediate response, now I have the idea.
thanks,
dfan23
|
|
|
|
|
Hi. I'm quite new to using DataSets/DataAdapters.
At first, I tried to populate my DataSet (which consists of several tables) with one select query, like so:
var cmd =
new SqlCommand("SELECT * FROM TableOne;SELECT * FROM TableTwo", con);
myDataAdapter= new SqlDataAdapter(cmd);
myDataAdapter.Fill(ds);
I then proceed to set the primary key for TableTwo in the dataset and instantiate a SqlCommandBuilder with the Adapter as parameter.
When I eventually call myDataAdapter.Update(ds.Tables["TableTwo"]); the adapter gets confused and complains that it can't find a column from TableOne in TableTwo. I googled around and read that you can fix this problem by using seperate DataAdapters for each table in the DataSet. I tried this, creating a new SqlCommand for each adapter with only one select query in each, but calling the second myDataAdapter.Fill overwrites the contents of the DataSet completely!
Of course I could use seperate DataSets for each table but that seems like the incorrect solution. I've googled for tutorials and examples but all of them are too simple to help me (never more than 1 table in the DataSet, and some other issues as well).
Basically, I'd appreciate some advice on how to approach this problem - is it doable with one DataAdapter? if so, how do I get the DataAdapter to understand my DataSet (which seems to be the problem here..)? Otherwise, how do I use more than one DataAdapter to populate a single DataSet?
Thanks in advance for any help...
|
|
|
|
|
I may have found a solution - naming the tables directly after calling Fill SEEMS to help. I always get these revelations just after posting....
|
|
|
|
|
Hello,
I made my installer using VS2008, and I want to detect a driver for my device is already installed on the PC or not (At that time device is not attached to PC).
And depending on installed status - yes than skip driver installation,
if - NO - than install driver.
How to do this?
Any help, info, link is really appreciated.
|
|
|
|
|
Hello,
How can I read a multiple REG_MULTI_SZ value from the registry in interop? (the language is irrelevant)
The reason for the interop is: reading a REG_MULTI_SZ value from a x86 compiled .NET app in the 64bit registry hive of a Win2008 64bit machine.
The option to compile Any CPU is not relevant at the moment in case someone wonders
Many thanks in advance for any help.
Alberto Bar-Noy
Project Manager
http://www.consist.co.il
|
|
|
|
|
Hi all,
I have a little question about a ComboBox:
When program start, such ComboBox is automatically populated with 15 Items that I specified in developing time in the ComboBox Items Collection property.
During the running, such Combo can be cleared and re-populate with another set of items(variable values).
Is there a way (in VB .Net Framework) to restore back (reset) the Combo with original set of Items with a single instruction, without the need to store original values in an array and re-populate items one by one?
Thanks.
|
|
|
|
|
No, the items you entered in Visual Designer end up in the InitializeComponents() method; if you were to call that again, it would recreate all your initial Controls, something one seldom wants.
I would:
- not populate them with Designer;
- create a simple method that populates the ComboBox list;
- call it in the constructor (right after the call to InitializeComponents);
- call it again whenever you feel you have to.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Hello,
I would like to ask how can I show what I have recently updated in my database
I just use textboxe's to show my data but my problem is that I does not show it yet
until I restart my program.Not like my delete command that it immediately affect
what changes I have made in the database.
Problem Conclusion:
How to immediately show changes made after updating the database
For more details below here are my codes:
My Declarations:
Dim con As New OleDb.OleDbConnection
Dim da As New OleDb.OleDbDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Dim sSQL As String
Dim maxRows As Integer
Dim inc As Integer
My sub to display my database records to textbox:
Private Sub setRecords()
Try
'set the specific records
txtProduct_ID.Text = dt.Rows(inc).Item("productID")
txtProductName.Text = dt.Rows(inc).Item("productName")
txtProductDescription.Text = dt.Rows(inc).Item("productDescription")
txtProductCategory.Text = dt.Rows(inc).Item("productCategory")
txtProductStatus.Text = dt.Rows(inc).Item("productStatus")
txtProductPrice.Text = dt.Rows(inc).Item("productPrice")
txtProductQuantity.Text = dt.Rows(inc).Item("productQuantity")
datePicker.Text = dt.Rows(inc).Item("productDateAdded")
'disable editing when form in load
txtProduct_ID.Enabled = False
txtProductName.Enabled = False
txtProductDescription.Enabled = False
txtProductCategory.Enabled = False
txtProductStatus.Enabled = False
txtProductPrice.Enabled = False
txtProductQuantity.Enabled = False
datePicker.Enabled = False
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
MY code in update:
con.Close()
Try
con.Open()
Try
'add a new row
Dim Rows As DataRow
Rows = dt.NewRow
Rows.Item("productID") = Val(txtProduct_ID.Text)
Rows.Item("productName") = txtProductName.Text
Rows.Item("productCategory") = txtProductCategory.Text
Rows.Item("productDescription") = txtProductDescription.Text
Rows.Item("productStatus") = txtProductStatus.Text
Rows.Item("productPrice") = Val(txtProductPrice.Text)
Rows.Item("productQuantity") = Val(txtProductQuantity.Text)
Rows.Item("productDateAdded") = datePicker.Text
dt.Rows.Add(Rows)
Catch ex As OleDb.OleDbException
MsgBox(ex.ToString)
End Try
'save changes made to the database
sSQL = "SELECT * FROM productTable"
da = New OleDb.OleDbDataAdapter(sSQL, con)
Dim cb As New OleDb.OleDbCommandBuilder(da)
da.Update(dt)
'move to last records of the database
inc = -1
If inc <> maxRows - 1 Then
inc = maxRows - 1
setRecords()
End If
con.Close()
MsgBox("Records Succesfully Saved")
Catch ex As OleDb.OleDbException
MsgBox(ex.ToString)
End Try
End Sub
my code in delete:
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim a As MsgBoxResult
a = MsgBox("Are you sure you want to delete this Record ?", MsgBoxStyle.YesNo + MsgBoxStyle.Critical, "Deleting Records")
If a = MsgBoxResult.Yes Then
Try
Dim cb As New OleDb.OleDbCommandBuilder(da)
dt.Rows(inc).Delete()
maxRows = maxRows - 1
inc = 0
setRecords()
da.Update(dt)
MsgBox("Records Successfully Deleted")
setRecords()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Else
MsgBox("Deleting Records have been canceled!")
End If
End Sub
Thanks,
dfan23
|
|
|
|
|
All in all, you have Delete, Insert, Update in a class, so you can declare an Event (Modified), and subscribe to it. When it fires, call setRecords sub. In C# it looks as follows:
public event EventHandler<EventArgs> DatabaseDataModified;
protected virtual void OnDatabaseDataModified(EventArgs args)
{
if(DatabaseDataModified != null)
DatabaseDataModified.Invoke(this, args);
}
Call OnDatabaseDataModified method everytime a record is updated in the database.
Subscribe to DatabaseDataModified event and call setRecords sub, once the event handler fires. For a more detailed review check publish/subscribe model.
|
|
|
|
|
I hv to get control reference in thread method let suppose in this example i m setting text lable of text control but it gives exception at Statment TextBox1.Text="DFD"
Exception is
Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on.
code is below
Public Class data
Private myUtil As Util = New Util()
Private strSQL As String = ""
Public Sub savedata()
'Label1.Text = "DFDF"
' Dim d As data
TextBox1.Text = "DFDF"
Try
strSQL = "Insert into tbldata(pid,pname,pdesc) values(2, 'abc', 'description1')"
If (myUtil.ExecuteDBCommand(strSQL) = 1) Then
'MsgBox("Account(s) Assigned Sucessfully!")
Else
MessageBox.Show("Could not Save Record!", "Account Information!", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
Catch ex As Exception
End Try
End Sub
Private Sub data_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim t1 As Threading.Thread = New Threading.Thread(AddressOf savedata)
t1.Start()
End Sub
End Class
plz help
|
|
|
|
|
|
great reference!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
That's exactly why I used it
|
|
|
|
|
I'm looking for a tool or a standard for writing software requirements (SRS) for a .NET application.
Does anyone have any tips on this matter?
|
|
|
|
|
|
I see your point - thanks Mark!
|
|
|
|
|
hii all i want to create a desktop application using csharp .net.
can anybody give me link from where i can learn how to create windows application(project)
,database connectivity etc.plz help.....
|
|
|
|
|
You should be reading a .Net book. Almost all books have samples.
Have a look here.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|