|
Otekpo Emmanuel wrote: I really wanted to do this with vb.net Ah. Sooo, if I help you to build this in VB.NET succesfully, you'd be equally happy?
Otekpo Emmanuel wrote: So any help will be welcome. You've got the VB.NET IDE installed?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hello !
I have a BindingSource , and some control bound to it.
Sometimes the data on bindingsource is changed
How can I do that when the data of current object on bindingSource is updated , the corresponding controls in the form bound to changed fields change the background color for example to Red?
I know that there's an event BindingSource.CurrentItemChanged that is fired when the changes are made.
But how can I find the fields that have changed , and the control that is bound to this field ?
Thank you !
|
|
|
|
|
dilkonika wrote: the corresponding controls in the form bound to changed fields change the
background color for example to Red? What did you bind to? A TextBox? Does that have something like a "TextChanged" event?
Color the sender.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you , but the situation is different.
I have Textboxes, Comboboxes , ...etc bound to bindingsouce.
But the changes are made directly to bindingsource and not to controls bound to it. so when the binddingsourc is changed , I want to find the field that has changed , after I want to find which control is bound to that field and after I want to change the color of that control.
|
|
|
|
|
dilkonika wrote: I want to find the field that has changed I'm not even sure whether or not the BindingSource exposes that information. The DataMemberChanged[^] event looks promising. It might not express "what" has changed, but you could always compare the old version to the new one, provided you have access to those.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I wrote a windows service, and used the event log to log messages to the Applications event log.
But I would like to complete the project with a companion DLL file that contains the error codes and messages, so the messages output clean, and that I have a list of valid error codes to go with them
I've been googling this, but can't seem to find anything for doing it in VB, a class DLL.
I saw the messages.mc file examples, a gave it a whirl in win32, but that's alot of work, and I think there was some restrictions because I did it in VB.
Is this even possible to do?, what keywords would be used for finding some examples.
modified 10-Oct-14 13:12pm.
|
|
|
|
|
You could build an assembly with a single resource-file. A dictionary of strings.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I can do that in the new DLL, or the windows service exe?
|
|
|
|
|
You could also add it to the Windows Service
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Quick-guide;- Right-click solution in solution-explorer, add item
- Tab "General", choose "Resource File".
- Name it "Errorz.resx".
- Click on "String1", rename to a192432.
- Click on value, add "Ants ate your harddrive."
- Hit Ctrl-Shift-S and go to code
Console.WriteLine(global::YourNameSpace.Errorz.a192432);
If it is in a different assembly, then you'd need to add a reference of course. That way you could also easily translate the messages. There's a project here on CP that does that autmatically using Google Translate. It does not do perfect translations, but it is easier to correct a few sentences than it is to type a lot of them
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
OK thanks!
I spent more hours last night on it, researching what Eddie suggested.
I made a DLL in VB, but it failed. Oh Well. Think I might give the .mc file a manual compile using the command line.
But I will read the articles first.
|
|
|
|
|
|
I'm the beginner. I want to make a dictionary program using MS Access and VB.Net. I want to be in my program when type a word in text box 1 to search then show the meaning in another text box 2. That's all. I don't know how to search and call from Access database. Please help me. I need first. Please. That's my project for my school.
VB.Net, Access
|
|
|
|
|
|
|
Try this out!
At the top most of your code window, type these name spaces
Import System.Data
Import System.Data.Oledb
double click on the search button and type or copy the below code
Dim con As New Oledb.OledbConnection("Provider=Microsoft.Ace.Oledb.12.0; Data Source = theDatabasePath")
Dim cmd As New Oledb.OledbCommand("select * from tblname where srchName = @srchName", con)
cmd.Parameters.AddWithValue("@srchName", txtsrch.Text)
Dim dr As Oledb.OledbDataReader = cmd.ExecuteReader
if dr.HasRows Then
dr.Read()
txtresult.Text = dr("srchName")
else
MsgBox("Name not found")
End if
dr.Close
cmd.Dispose
con.Dispose
con.Close
//////
Explanation
the srchName, I assumed to be your field name.
Table name is the name you gave your table at the backend
databasepath is the path that lead to your database. You can get the db path by right clicking on the database tehen select properties
|
|
|
|
|
Thanks u very much ... Thanks u
|
|
|
|
|
I was looking into using data annotations to help validation on one of my classes. However, in my class there is a property called CommandFamily which is a Byte . This property must have a value of 0x01 - 0x07 or 0xFF.
I have already applied the Required attribute and was looking into using the Range . However the Range attribute can only accept a minimum and maximum value and you cannot apply more then one Range attribute.
I checked on MSDN and I don't see any other attribute that will allow you to apply a list of values. I would really like to avoid having to change the acceptable values for the CommandFamily property if possible. Is there any way data annotation attribute, or combination, that will allow me to specify a range of acceptable values, instead of just a single range?
Thanks in advance for any assistance or guidance on this.
A black hole is where God tried to divide by zero.
There are 10 kinds of people in the world; those who understand binary and those who don't.
|
|
|
|
|
The simplest option would probably be to use the CustomValidation attribute[^] to call a Public Shared method to validate the value.
Public NotInheritable Class CommandFamilyValidator
Public Shared Function Validate(ByVal commandFamily As Byte) As Boolean
Return commandFamily = &H01 _
OrElse commandFamily = &H07 _
OrElse commandFamily = &HFF
End Function
End Class
...
<CustomValidation(GetType(CommandFamilyValidator), "Validate")> _
Public Property CommandFamily As Byte
...
Alternatively, you could create your own validation attribute by inheriting from the ValidationAttribute class[^]. This SO answer[^] has an example.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All
I comme back with another Question.
i have followed droptiles tutorial and I would like to implement It. But I would like to display in the tile content (at the place of image) a div contening a chart. could you please help me achieve it? thanks in advance for your help!
Notice: I have around 10 of my usercontrol in the page, each one with its chart.
Sorry for my english. i hope you will understand my request.
Here is what a started
<div id="metro-sections-container" class="metro">
<div class="metro-sections">
<div class="metro-section" data-bind="foreach: tiles">
<div class="tile">
<div class="tile-icon-large">
<%----%>
<%----%>
</div>
</div>
</div>
</div>
</div>
and the script:
<script>
function Tile(param) {
this.label = ko.observable(param.label);
this.count = ko.observable(param.count);
this.icon = ko.observable(param.icon);
this.MyuserControl = ko.observable(param.MyuserControl);
}
var tile1 = new Tile({
label: "Label 1",
count: 10,
icon: "img/CutTheRope.png",
MyuserControl: "What will be here?"
});
var tile2 = new Tile({
label: "Label 2",
count: 20,
icon: "img/Desktop.png",
MyuserControl: "What will be here?"
});
var tile3 = new Tile({
label: "Label 3",
count: 30,
icon: "img/avatar474_2.gif",
MyuserControl: "What will be here?"
});
function ViewModel() {
this.tiles = ko.observableArray([]);
}
var viewModel = new ViewModel();
viewModel.tiles.push(tile1);
viewModel.tiles.push(tile2);
viewModel.tiles.push(tile3);
ko.applyBindings(viewModel);
window.setInterval(function () {
ko.utils.arrayForEach(viewModel.tiles(), function (tile) {
tile.count(tile.count() + 1);
});
}, 1000);
window.setTimeout(function () {
viewModel.tiles.push(new Tile({
label: "Label 3",
count: 30,
icon: "img/avatar474_2.gif",
MyuserControl: "What will be here?"
}));
jQuery('.metro-section').sortable();
}, 1000);
</script>
|
|
|
|
|
Wrong forum; try one of the web development forums on here.
|
|
|
|
|
I need to compare 2 tables and show the difference like this:
CurrentValue-Change Status(Delete,update,new)- PreviousValue
Test1 Update Test
Dim dtBenefitsCurrent As New DataTable=GetData()
Dim dtBenefitsPreviousYear As New DataTable=GetData()
?????
dtBenefitsCurrent.Merge(dtBenefitsCurrent)
Dim changesTable As DataTable = dtBenefitsCurrent.GetChanges ???????
|
|
|
|
|
Hi,
Can you do it this way ?
Dim tblDiff As DataTable = (From rA In dtBenefitsCurrent.AsEnumerable()Join rB In dtBenefitsPreviousYear.AsEnumerable() On rA.Field(Of Integer)("RowID") = rB.Field(Of Integer)("RowID") Into joinedRowsFrom ab In joinedRows.DefaultIfEmpty() Where ab Is NothingrA).CopyToDataTable(
I havent tested this, hence plz try and revert.
Hope this helps !!
Regards,
Praneet
|
|
|
|