When you declare the function/sub to be "Shared", it becomes a method of the class, not of an instance! And that means that that method cannot by itself access memebers of an instance of that class. Just ask yourself: when there is more than one instance, which instance should that be? Consequently, you have to pass all instance variables required to that function.
This question is impossible to answer in a forum such as this, and no one is likely to provide "help right from designing till coding". Try a Google search for the subjects that you need to understand in your project, and try the Articles section[^] here on CodeProject.
The first thing you need to do is to approach the client to find out what the requirements are. Find out how the application will actually be used (what the use cases are), and then look to break that down into manageable, easily created chunks. That's how you start.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
An OMR application will require a collection of image zones which you compare with supplied images to determine if an acceptable amount of pixels have been provided in any zone to create a 'hit'. There is usually a user interface to address values in a questionable range. Values that make no sense, such as two marks in a row requiring only one mark, must also be resolved by a user, or predefined rule.
Your correct. Sorry it was a long day and for some reason LPT1 was in my head and not printing. I was looking for a way to open and write raw data to parallel port.
Now that I have had a good night sleep, it seems like there is a way to write raw data to printer using the System.Drawing.Printing namespace. If I get time I'll dig out one of my old projects, I think I actually have done raw mode to printer, although it may have been over TCP/IP not parallel port???
I want to make a source code collection to use like a reference
and save tutorial source codes with those information into that collection
and I need somethings like 'Source Code Annotation' Like 'Code tools' of 'Post Message' from this website...
Help me... whatever however about that
I Use VB.Net ...
Thanks, for your reply ...
Maybe if you bothered to read the article you would find out how it worked and how it might be able to help you. You really need to make a bit more of an effort for yourself and not expect to be spoon fed for the rest of your life.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
I wanted to know if I can use Aforge library for YUV display in a GUI that I want to create, I just wanted to know if I can use Aforge for this?,
I have used OpenCV for this, But that is not customizable. Thus exploring other options
Dim ms As New MemoryStream
Dim strType As String = ToolStripStatusLabel1.Text.Substring(ToolStripStatusLabel1.Text.LastIndexOf("."), 4)
Dim arrImage() As Byte = ms.GetBuffer
Dim strFileName As String = IO.Path.GetFileName(ToolStripStatusLabel1.Text)
Dim connectionString As String = "Data Source=MIKEY-HP\jtsql;Initial Catalog=Images;Integrated Security=True"
Dim cnn As New SqlConnection(connectionString)
Dim DateFiled As Date = FormatDateTime(Now(), DateFormat.ShortDate)
Dim strSQL As String = _
"INSERT INTO ImageTab (ImageData,Type,ImgFileName,DateFiled)" & _
"VALUES (@ImageData,@Type,@Filename,'" & DateFiled & "')"
Dim cmd As New SqlCommand(strSQL, cnn)
.Parameters.Add(New SqlParameter("@Filename", SqlDbType.VarChar, 50)).Value = strFileName
.Parameters.Add(New SqlParameter("@Type", SqlDbType.VarChar, 10)).Value = strType
.Parameters.Add(New SqlParameter("@ImageData", SqlDbType.Image)).Value = arrImage
Catch ex As Exception
Catch ex As System.Exception
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.
public Overrides property [Descr]() as String
set (ByVal value As String)
me.p_Descr = value
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()
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?
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'stostring() 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;
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.
You should try to get the movie from the context using LINQ.
usingvar 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;
// Movie was not found.
context.SaveChanges(); // Should work now!
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???
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:
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?