|
I have the code.....
Dim myDataView As DataView
Dim dt As DataTable
dt = League.Tables(0)
myDataView = dt.DefaultView
myDataView.Sort. = "Points"
But when it sorts the points, it does it in reverse. Lowest to highest instead of highest to lowest.
E.G. Instead of
0 8
2 6
3 3
6 2
8 0
|
|
|
|
|
|
I have a fixed size dataset which I need users to be able to update, but not add new records.
so I need to be able to disable inserting/adding rows in datagrids in VB.Net without turning off updating.
The only way I have found to disable updating in any way is the set the datagrid readonly property to true.
Any suggestions will be welcomed
Tim Emjay
Small Systems Developer
|
|
|
|
|
Setting readonly=true is the best solution since you don want to update the datagrid....You can update the dataset anytime
_mubashir
|
|
|
|
|
I do want to be able to update the datagrid, I want to stop the addition of rows in the datagrid.
Tim Emjay
Small Systems Developer
|
|
|
|
|
Can you display text box values in one form that was entered in another form rather than assign them as global variables. If so how is this done?
Example
Form1
TextBox1 = 3
Form2
TextBox1 = Form1.textbox1.text
|
|
|
|
|
Your on the right track.
'Form1
Textbox1.text = "TEST"
'Create new instance of form 2
Dim frm as new Form2
'Assign the textbox properties
frm.Textbox1.Text = Textbox1.text
'Show the form
frm.ShowDialog
|
|
|
|
|
Hi,
I´m new in the forum and in VB.NET and i have a few doubts. I want to do and aplicattion which should get documents from a folder and show them in a form as a link but i don´t now how to do that. If any of you should now how to do that i´ll apreciate it.
Thanks for all,
Rincito
|
|
|
|
|
Code to get files from directory.
Function GetMyFiles(byval directory as string) as string()
Dim theFiles() as string
theFiles = System.IO.Directory.GetFiles(directory)
return theFiles
End Function
Code to add link to form.
Sub AddALink(ByVal name As String, ByVal x As Integer, ByVal y As Integer)
Dim aLink As New LinkLabel
aLink.Text = name
Dim thisSpot As New Point(x, y)
aLink.Location = thisSpot
Me.Controls.Add(aLink)
End Sub
Code to Make it all work
Sub RunIt()
Dim s As String
Dim x As Integer = 5
Dim y As Integer = 10
For Each s In GetMyFiles("C:\")
AddALink(s, x, y)
y += 25
Next
End Sub
The only problem left that maybe someone else can answer is how to wire up all of the click events. As of this point the links are added to the form, but if you click one, nothing happens of course.
|
|
|
|
|
Thanks,
I´m going to try it as soon as possible.
R
|
|
|
|
|
I am an developer and use SharpDevelop and OpenOffice.org Base for database purpose. Can i connect an OpenOffice database to an sharpdevelop project, so i can begin the programming. How i do programming an simple database with an datagrid in sharpdevelop?
|
|
|
|
|
I dont know anything about open office but i do use sharp develop quite a bit. Its pretty much the same as VS2003 but missing some of the wizards. It has exactly the same designer support for the datagrid and any code that works in VS will work in SD. You can use any of the samples here on CP or anywhere else and load them straight into SD. The main difference is SD uses 'Combines' instead of VS's 'Soloutions'. Just go to file and Import in SD to import a VS soloution into SD then use as normal.
Jon
|
|
|
|
|
As I have to add new funcionalities I'm thinking to take an app originally made with VB6 and migrate it to .Net platform.
Should I do this migration just to modernize it?
As I haven't developed any app under .Net, what's the best language to do it: VB .Net, VC++ .Net or C#?
I come from the VC++6 world and I've always believed that VC++ was the best platform to build Object Oriented apps that needs an straight control of the hardware, windows messages, reusable code, ... and VB6 was made for "office" apps that needed db connection and with a faster design and development.
AFAIK VB .Net has improved quite a lot because it's been powered with full O.O. characteristics, multithreading, inheretince, ... so now, VB .Net permits to build better reusable code than its predecessor.
What's the role of C# in this world? Is it just a Microsoft alternative to Java but it has the same targeted apps as VB.Net?
Thanks for your comments,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-- modified at 3:05 Wednesday 7th September, 2005
|
|
|
|
|
If the app was written in VB, then VB.NET is probably a reasonable choice.
C++ is still the best choice if you have issues like hardware control and other low level functions. As far as OOP, any of the NET langauges are suitable.
marcdev wrote:
What's the role of C# in this world? Is it just a Microsoft alternative to Java but it has the same targeted apps as VB.Net?
Yes. Exactly. VB.NET and C# atre essentially identical in functionality. VB.NET syntax is familiar to VB programmers, and C# is familiar to Java programmers, but they both run on the same framework and compile to identical machine code.
|
|
|
|
|
rwestgraham wrote:
C++ is still the best choice if you have issues like hardware control and other low level functions
I have to access to serial and parallel port, so I think VB .Net has full access to this. In the near future I'm planning to access via sockets so I think it either won't be a problem in dot net.
What about using VC++ mixing managed and unmanaged code? Is it a solution to make the classical VC++ coder having their mouths closed or it's, and it'll be, a good option?
I know that these questions are difficult to answer because they depends on microsoft plans ... I just want to know your impressions.
Thanks,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Hello everybody. One small question:
How can i make a console window not to be visible and hide it from Task manager. I am trying to make a program that it's not visible to the users and since app.Taskvisible is not supported in vb.net, i need to create a console application to bypass this.
Thank you.
Still trying to find the way
|
|
|
|
|
You may want to consider making the program a service.
|
|
|
|
|
KaptinKrunch, I forgot to mention that i have the Standard version of VB.NET and it doesn't make programs as services. I am tinkering with an Application Console, but i can't hide it from the Task Manager. I have heard that you can do that. But how??????
Thank you though for your input.
Still trying to find the way
|
|
|
|
|
Can some guide me?
Actually I want to convert a Java Class into the .Net DLL.
What should I do for this?
|
|
|
|
|
Well, your best bet is definately C# and not VB, because C# looks a lot more like Java. Create a dll, then start porting the code, line by line.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What is wrong with this code?
<br />
Structure PP<br />
<br />
Public Name As String<br />
Public Archive As Boolean<br />
<br />
End Structure<br />
<br />
Public Sub Inst()<br />
<br />
Dim AddPP As New PP<br />
With AddPP<br />
.Name = txtPPName.Text<br />
.Archive = True<br />
End With<br />
<br />
cmd = "INSERT INTO Pub_Points (PPName,Archive) VALUES ('" + AddPP.Name + "'," + AddPP.Archive + ")"<br />
<br />
End Sub<br />
It chokes with 'System.FormatException: Input string was not in a correct format.'
This is my current kluge:
cmd = "INSERT INTO Pub_Points (PPName,Archive) VALUES ('" + AddPP.Name + "'," " + CInt(AddPP.Archive).ToString + ")"<br />
But what is the point in defining a property as boolean if I have to convert it back to string to use it?
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
-- modified at 17:20 Tuesday 6th September, 2005
|
|
|
|
|
DaveC426913 wrote:
But what is the point in defining a property as boolean if I have to convert it back to string to use it?
You do have to convert it into a string, it's a string because it's part of cmd, which is a string. VB is doing this for you implicitly in the first instance. What does cmd look like in the debugger in the first instance ? What's the type of the Archive column in the database ? If you go into Query Analyser, what changes do you need to make to the string in cmd in the first instance, for it to work ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
"You do have to convert it into a string, it's a string because it's part of cmd, which is a string."
Did you mean *I do* or *I do not* have to?
"What does cmd look like in the debugger in the first instance ?"
It doesn't. It chokes trying to parse that line of code. This isn't a db problem, it's a VB problem.
"What's the type of the Archive column in the database ?"
Sorry, it is bit.
"If you go into Query Analyser, what changes do you need to make to the string in cmd in the first instance, for it to work?"
Well, I have to change T/F to 1/0, which is what I'm doing.
Which brings me back to my question: why am I bothering to Dimension it as boolean?
A thought: Should my structure have a get/set that automatically converts between T/F and 0/1?
________________________________________________________________________
Dave
Y10K bug! Let's not get caught with our pants down **AGAIN**! (DC 02002)
-- modified at 9:13 Wednesday 7th September, 2005
|
|
|
|
|
DaveC426913 wrote:
Did you mean *I do* or *I do not* have to?
You *do*. the variable cmd is a string. Therefore, you have to turn whatever you pass through into a string, to make it part of the string command.
DaveC426913 wrote:
It doesn't. It chokes trying to parse that line of code. This isn't a db problem, it's a VB problem.
OK, in that case, VB isn't magically turning your boolean into a string, call it's .ToString method to get what you need.
DaveC426913 wrote:
Well, I have to change T/F to 1/0, which is what I'm doing.
Query Analyzer needs a 1 or 0, not true or false ? In that case, does VB support ? : notation ? As in myBool ? 1 : 0, returns 1 if myBool is true, otherwise returns false ?
DaveC426913 wrote:
A thought: Should my structure have a get/set that automatically converts between T/F and 0/1?
I'd try to do it inline. Or, if you used stored procedures, you can pass them a bool as a parameter, and the SP will turn it into what is needed. That's what I do, which is why I wasn't sure if SQL Server accepts true/false as bit values.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is there a function in .NET web stuff that will test a string for script attacks. For example, it tests for javascript code and html in the string the user entered in a first name blank
Thanks,
Tom
|
|
|
|