|
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
|
|
|
|
|
I have copy your code and its not working
|
|
|
|
|
Hi, I am beginner and I am using Highcharts for first time but I am experiencing same difficulties.
I looking for a sample of code which can how to configure and update highcharts in vb.net (change type, set Axis format, change background-color, make refresh, etc. I am using Visual studio 2008
|
|
|
|
|
Those appear to be JavaScript-only charts for use in web apps and with no ASP.NET server-side wrappers. This means you can't set them up from your VB.NET code. There won't be any samples in VB.NET.
If they support Ajax calls back to your server (ASP.NET and MVC), then you can send JSON formatted data back to them and they might update themselves.
There are demos on their own site, but they are going to be JavaScript only.
There is also a CodePlex open source project called DorNet.HighCharts, found here[^], but who is working on the project and support is up to you to determine if it's useful.
|
|
|
|
|
Hello !
I'm using entity framework with vb.net.
I need to know , which is the value of Context.Entry(Myobject).state in these cases :
1) I Add Myobject as new (Savechanges is not called yet) and after I modify it ?
2) I Add Myobject as new ( Savechanges is not called yet) and after i delete it ?
3) MyObject is a parent , and I add a new child for it ?
Thank you !
|
|
|
|
|
How about this. TRY IT!
Its' not that hard to figure out if you just set a breakpoint on the SaveChanges call and look at the values in the object in question in the debugger.
|
|
|
|