|
GOURANG.RASTOGI wrote: like a tally finds in vb.net
Not everyone is aware of what Tally is or how it works. Please be specific in what you are trying to achieve and where are you stuck.
|
|
|
|
|
My ticketing system has reached a point where the installations will need to communicate with the office. I cannot guarantee constant connectivity.
I am thinking of SOAP with Web Services. It appears easier to follow than TCP networking and in my limited knowledge perhaps better suits my needs.
Traffic will not be constant and it will function more as a notification device telling the office what transactions have taken place onboard, and the office will then notify other installations of tickets sold elsewhere.
What should I be looking out for?
Ger
|
|
|
|
|
Hello
I have a class :
cls_Communication_base
which has a private variable
Private p_Descr as String = nothing
and a public property
public Overrides property [Descr]() as String
get
return me.p_Descr
end get
set (ByVal value As String)
me.p_Descr = value
end set
end property
I have some load method, which loads data
from a data table and assigns the value from
the datarow to the property
row is a datarow from a datatable with 47000 Records
public overrides sub fillDataRow(byval row as system.data.datarow,byval bolBuffer as boolean)
...
If (Not row.isNull(5)) Then
' this line is too slow, really!!!!!!!!!!
me.Descr = row(5).tostring()
End If
....
end sub
Like said. Everything is ok in terms of speed. Only the line assigning the row value to the string property is really slow.
OK. I am skipping a lot of lines here to make the example easy. But, Without this line assigning the value to the property (but creating 47000 instances of my class and doing everything like querying the database takes Zero Seconds). Just including this one line and the whole thing needs 72 seconds
So, I guess there is something wrong in my way assigning strings to a property
Is there a better way assigning values to a string property?
Many thanks for helping
|
|
|
|
|
Not sure that there's any other way let alone a better one!
|
|
|
|
|
There is no other way to do this.
Since creating a string involves memory allocation and filling in of data, remember, you're doing this 47,000 times!
If your case, you're also looking up an array item then calling ToString() on that object. You're doing a lot of stuff to create a string, so the trick is to have the string already created for you, like in an XML document or something...
|
|
|
|
|
I'd bet the problem is not in the string assignment but in the call to tostring() . Strings are objects with reference semantics. They are assigned by copying an address (think "pointer"). This is not going to be expensive. (Well, for a property it calls the setter method which simply does the simple assignment, and a good compiler will optimize this to eliminate the call overhead. You are doing timing in Release mode, not Debug, right?)
This can be verified by removing the assignment but keeping row(5).tostring() and ignoring the returned string.
The real questions are:
What type of object does row(5) return?
How expensive is it's tostring() implementation?
|
|
|
|
|
I am currently learning EF and I am coding a Windows app as part of the learning process.
Given this code fragment:
using (var context = new MovieList_EFEntities())
{
string esql = "select value m from Movies as m Where m.MovieId = " + Convert.ToInt32(movieId) + "";
var Movies = context.CreateQuery< Movie>(esql);
foreach (var movie in Movies)
{
movie.Name = tbTitle.Text;
context.SaveChanges();
}
}
SaveChanges throws an exception - New transaction not allowed.
The Movie entity maps to the equivalent database table composed of 2 fields, the PK (identity) and the Name field. I want to change the Name. Why is the above not permitted?
As a workaround, I created a Movie object with the 2 field values assigned. I did not get the desired effect. My db record was not updated, rather, EF inserted a new record. I will figure this out eventually. Was hoping someone can help me out before I do.
Thank-you.
|
|
|
|
|
You should try to get the movie from the context using LINQ.
using var context = new MovieList_EFEntities())
{
int id = Convert.ToInt32(movieId);
Movie mov = context.Movies.SingleOrDefault(m => m.MovieId == id);
if (mov != null)
{
mov.Name = tbTitle.Text;
}
else
{
}
context.SaveChanges();
} Hope it helps, good luck!
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
I figured it out eventually.
I agree with you. Better to use LINQ.
Thank-you for the reply.
|
|
|
|
|
Glad you found it. No problem!
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
How to Install and use in Windows Xp Created Windows Service via VB.Net???
|
|
|
|
|
|
I have a problem with my project ...
I haven't 'Project Name' in 'Output Project Group' Dialog box...
mean: Nothig exist in this dialog on my project!!!
How can I to Access project information from that dialog box???
modified 4-Jul-12 5:12am.
|
|
|
|
|
Some suggestions:
1. Don't end every statement or question with smileys; use proper punctuation and people are more likely to take you seriously.
2. Think about your problem and try to describe it in clear detail with examples where necessary. Remember that no one but you can see what is on your screen.
In the above:
ICEFLOWER2 wrote: I haven't 'Project Name' in 'Output Project Group' Dialog box
What dialog box are you referring to and which tab: Project Properties or something else?
|
|
|
|
|
Simple Windows Service Sample Simple Windows Service Sample[^]
To add MyNewService.exe to the setup project
In Solution Explorer, right-click MyServiceSetup, point to Add, then choose Project Output. The Add Project Output Group dialog box appears.
MyNewService is selected in the Project box.
From the list box, select Primary Output, and click OK.
of Setup Project ...
|
|
|
|
|
Thank you for your answer
|
|
|
|
|
Are you doing ANY research yourself, or do you think that we are here to answer every question that you have instantly? Based on the number of questions you have posted here recently, I would recommend that you read this[^] book as you obviously understand at least some of VB.NET. This book will help to fill the missing bits in your knowledge.
|
|
|
|
|
hi
add setup and deployment project and add project output in your existing windows service.
and add custom action in setup and deploy project
Add Application Directory in that project
Finaly Build Relies mode
vijay
|
|
|
|
|
How Can I Change/Set Registry Keys Access Control to use???
Please Leave VB.Net Example...
Thanks...
|
|
|
|
|
The first question is WHY? Why would you want to do this?
The next question is WHERE? Your application really isn't setting any security because the applciation runs as the user. So, you're really not securing anything by letting the user do it.
Any security changes are normally done in the application installer.
But, of course, that depends entirely on what your application does and who's running it.
|
|
|
|
|
The first question is WHY? Why would you want to do this?
For example I have a Bluetooth Device/driver in Device manager like:
<Modem over Bluetooth Link#4>
But that device information in registry has some info more than it like:
<Modem over Bluetooth Link>
<Modem over Bluetooth Link#1>
<Modem over Bluetooth Link#2>
<Modem over Bluetooth Link#3>
I Want to remove and change to default...
If you know easy way to this please leave source code for it or ...
|
|
|
|
|
So what do you think changing the security on a registry key is going to do for this??
And which registry key are you thinking of changing??
|
|
|
|
|
|
And? That picture doesn't answer the questions at hand. What do you think changing the security on a registry key is going to do for this??
It appears that your code isn't checking to see if the modem is enabled or valid in some way.
|
|
|
|
|