|
mecracked wrote:
I certainly hope thats possible in VB6.
Possible, but not easy. You essentially have to create all the forms and custom controls from scratch, ownerdrawing nearly everything. Something VB6 doesn't lend itself to easily and you'll find less and less help for this project on the web.
It would be much easier to do in C++, C#, VB.NET, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i'm a beginner user of vb.net.. i doing an application recently but i facing some of the problems. The problem is i don't know how to display the data from database and display it on the data grid so can anyone expert teach me how to do it?
|
|
|
|
|
see first thing you have to connect with the database and get the data from data u can get through dataAdapter.Then if u desugned dataset in ur app fill the dataset table with dataadapter then give the datasource for datagrid as dataset table
see the code as foows
Dataadapter.Fill(dataset.datatable)
Datagrid.DataSource=Dataset.datatable
U can directly also fill table
|
|
|
|
|
Hello everybody. I am having a problem with the picturebox control. I need to be able to print the containts of the picture box to a printer. I can't find the way to do it. I have a printPreview control which i can make to show the paper but i can't put the image in it and thus i can't make it to print.
I use e.Graphics.DrawImage(PictureBox1.Image, 0, 0) which puts the image in the paper, but not where i want it. I need the width of the image to fit to the width of the page between the margins, and the height of the image to be proposinal enlarged, or reduces so it follows the original aspect ratio of the picture. The origin of the picture to be in the corner of the top and left paper margin.
Arggg!! Any help! Pleeeeazeee!!
Trying to find the way
|
|
|
|
|
|
I created project using Remoting.
I created a Remoting Object have 2 function: one return a String and one return a Bitmap. The first function is Ok, but the second is not Ok. The Error occur that " Remoting cannot find field nativeImage on type System.Drawing.Image"
How can I do?
Can you help me! Thanks.
quangthien
|
|
|
|
|
Hi,
I am looking for a way to change a file's permission so that users does not have any access to the file. I would do this through code.
Any suggestions?
Thanks,
|
|
|
|
|
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden)
You can set whatever attributes you like, but you can't cause users who go looking to be unable to access the file, unless your program is logged in as admin, and they are not.
BTW, that C# code above, you'll have to convert it ( change | to OR, etc )
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks for the reply Christian. I came accros FileIOPermission in VS.NET help. Could this be use to accomplish what I want to do? I tried the following but it had no impact as far as I can tell.
Dim fileIOPerm1 As FileIOPermission
fileIOPerm1 = New FileIOPermission (FileIOPermissionAccess.NoAccess, "D:\test.txt")
fileIOPerm1.AllFiles = FileIOPermissionAccess.NoAccess
Thanks,
|
|
|
|
|
The MSDN on this is here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritypermissionsfileiopermissionclasstopic.asp[^]
Personally, I'm not sure how it could work globally - on what basis are you providing this permission ? Surely if you removed access to all files across all of Windows, the OS would crash and you'd never be able to log in again ?
Reading it, I think it allows you to specify what files the currently logged in user can access via operations of the File class, i.e. within your code only. That makes sense to me.
Making the files hidden is the best you're going to do IMO. If you deny them access, how is your code ( which runs under their security ) going to read or use it ? If the file is hidden and they find/mess with it, it's their problem. Hell, even if it wasn't hidden, it's their problem.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks Christian. I appreciate your help on this.
Zenu
|
|
|
|
|
Even if you hid the file, they would still have access to it. The only thing that will take away all access rights would be using NTFS permissions. But, you have a huge problem! It is possible for your application to take away the rights to the file, but impossible for it to get them back. The application runs in the security context of the user who launched it. Once this person gives up all his/her access rights to a file, there is not enough rights left to get access to it back.
Like Christian said, it's up to the user to behave around these files. If not, he/she shoot themselves in the foot and that's not your problem.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi I was wondering if anyone out there could point me in the right direction. I am attempting to create custom controls that would be allow for the binding of data. Eg.the checked list box. This control does not allow a user to bind data from a dataset through the properties section of a control. I am looking to bind the checked list box and listview controls in VB.net. Thank you.
|
|
|
|
|
Hi... I am a new user of VB.net so I appreciate this forum.
I am trying to set the DataSource for a DataGrid control on my form using code. Very straight forward question with a very straight forward answer that works well:
Me.daDataAdapterName.Fill(Me.DsDataSourceName.StoredProcedureName_SEL)
However, the DataAdapter and the DataSource for the Datagrid may change based on values from an underlying SQL Table. I want to set the DataAdapter and the DataSource to be based on values from this Table.
This is a very straight forward question and I have properly identified the values that I want and declared them as variables. Now, I want to use the variables in the appropriate statement when declaring the DataAdapter and DataSource for the Datagrid. Being that my background is in VBA, I would have used the following syntax:
Dim V1 as String (Whatever the Name of the DataAdapter is)
Dim V2 as String (Whatever the Name of the DataSet is)
Me." & V1 & ".Fill(Me." & V2 & " .NameofStoredProcedure)
This syntax does not work. What is the appropriate syntax for VB.net?
I have tried variations...
Me.[" & V1 & "].Fill(Me.[" & V2 & "] .NameofStoredProcedure)
and
Me.[" + V1 + "].Fill(Me.[" + V2 + "] .NameofStoredProcedure)
Nothing seems to work.
Suggestions would be greatly appreciated.
Thanks in Advance
Pat
|
|
|
|
|
You're wasting your time. You can't do what your looking at doing. On top of that, there is no reason to do it either.
What is this code trying to accomplish? I mean over and above needlessly trying to change the name of a variable...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave...
The code is trying to accomplish the following:
I am a firm believer in ComboBoxes to enter data. Whether you agree with this approach or not, is not the issue. All of my Comboboxes are limit to list – for very good reason. Accordingly, there must be some provision so the user can enter new choices into the database:
Method:
Historically (in VBA in MS Access) my method is pure simplicity: 1 Form, 1 Combobox, 1 Subform (Datasheet view), 1 SQL Table
• The Subform and all of its cells are unbound
• The layouts for the Subform, (Datasource, Number of columns, widths, etc) are set from a single DataTable.
• If the user wants to enter a new “City”, he/she chooses City in main Combobox
• Based on the value of the Combobox, a single record in the Table is accessed.
• This record provides information on how to setup the Subform (the number and widths of the columns, datasource etc)
• All of the existing choices then appear in the subform and the user is then able to make the necessary edits/additions.
Using VB.net: 1 Form, 1 Combobox, 1 Datagrid, 1 SQL Table.
• The Datagrid has no Datasource
• The Based on the choice from the single ComboBox, a SQL Table is accessed.
• This record provides information on how to setup the Datagrid (DataAdapter, DataSource, Stored Procedure, the number and widths of the columns, etc)
• All of the existing choices then appear in the Datagrid and the user is then able to make the necessary edits/additions.
This may sound complicated, in fact, it would be as simple as defining two variables (V1 and V2):
• Where V1 is the name of the DataAdapter.
• Where V2 which is the name of the Dataset.
Declaring these variables along with their appropriate values is easy but it brings me back to my original question… What is the proper syntax?
Me.V2.StoredProcedure.Clear() (Normally would read… Me.NameOfDataSource.StoredProcedure.Clear)
And
Me.V1.Fill(Me.V2.StoredProcedure) (Nomally would read…
Me.NameofDataAdapter.Fill(Me.NameofDataSource.StoredProcedure))
I am not trying to needlessly change a Variable. However, if I can set the DataAdapter, DataSource, columns, etc, for over 25 choices from a single form and a single Datagrid, then I have...
• far fewer controls;
• fewer datagrids (1 vs 25);
• a single place to add/edit Master List choices;
• less code to write/edit/maintain (a single function that contains roughly 25 lines of code)
• BUT the real beauty of this is that if I want to add another ComboBox to my application, I simply add a single record in the SQL Table identifying the appropriate DataAdapter, DataSource, Number and Widths of Columns, etc. I then add or modify a single DataAdapter and I am ‘good to go’
This is why I am wondering about a simple little piece of code although, I guess I could have 25 datagrids layered on the form.
Thanks
Pat
|
|
|
|
|
Capilano wrote:
I am a firm believer in ComboBoxes to enter data. Whether you agree with this approach or not, is not the issue.
Excuse me, but when did I say using ComboBoxes was a bad idea?
Capilano wrote:
Historically (in VBA in MS Access) my method is pure simplicity: 1 Form, 1 Combobox, 1 Subform (Datasheet view), 1 SQL Table
• The Subform and all of its cells are unbound
• The layouts for the Subform, (Datasource, Number of columns, widths, etc) are set from a single DataTable.
• If the user wants to enter a new “City”, he/she chooses City in main Combobox
• Based on the value of the Combobox, a single record in the Table is accessed.
• This record provides information on how to setup the Subform (the number and widths of the columns, datasource etc)
• All of the existing choices then appear in the subform and the user is then able to make the necessary edits/additions.
Using VB.net: 1 Form, 1 Combobox, 1 Datagrid, 1 SQL Table.
• The Datagrid has no Datasource
• The Based on the choice from the single ComboBox, a SQL Table is accessed.
• This record provides information on how to setup the Datagrid (DataAdapter, DataSource, Stored Procedure, the number and widths of the columns, etc)
• All of the existing choices then appear in the Datagrid and the user is then able to make the necessary edits/additions.
This may sound complicated, in fact, it would be as simple as defining two variables (V1 and V2):
• Where V1 is the name of the DataAdapter.
• Where V2 which is the name of the Dataset.
Declaring these variables along with their appropriate values is easy but it brings me back to my original question… What is the proper syntax?
This is what we needed! But, there is no proper syntax. What you want to do is possible, just not how you want to do it. You have to rethink your logic to use collections of objects, like a collection of DataAdapters. It's impossible to use "variable variable names".
A hash table can hold on to all the DataAdapters you want, in a key/value, or in your case, key/object, pair. The key will be the name of the adapter, and the object will, of course, be the dataadapter.
Hashtable Class[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Using variables probably won't work. You might have to resort to the old fashioned Select Case
Select variableName
..case V1
....dataAdapter code
....dataSet code
..case V2
....dataAdapter code
....dataSet code
.
.
.
end select
|
|
|
|
|
In my sql database, it's a binary value, when it binding to datagrid, it shows up "Ture" or "False". How can I change it output to "active" or "inactive"? Is there any way to do it? Thanks.
Lisa
|
|
|
|
|
Can you add a table to your database with the values you want and then join it to your current table(s)in the dataAdapter?
If you can't add the table to the current database, you make a separate database with the new table. I have seen instructions on joining tables from different databases
|
|
|
|
|
|
Hi,
If any body can give me a vb script code for reading all the messages that are there in an IBM MQ queue( of any type), I will be very thankful to you. Scenario is like this - Suppose the application fails and messages are getting logged into the queue, I have to read these logged messages from queue into a text file.
Thanks in Advance
Nasir
|
|
|
|
|
Hello.....
how can i get the MX Entries of a Domain???
Thanks....
|
|
|
|
|
What? Are you talking about DNS records or Active Directory?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
when i add a record in database the record is added.
but it does not shows the record when i press move next or prev. button. when i close the form and run again then it
display the added record. plz help me
'code
str = "insert into agent(agentid,agentname) values('" & txtagentid.Text & "','"& txtname.Text & "' )"
ds = dbcon.InsertDS(ds, str) 'insert record into database
ds.AcceptChanges()
ds.GetChanges(DataRowState.Added)
MessageBox.Show("One Record Added")
i am software engineer
|
|
|
|
|