@diafol This is the client requirement

I have to create a unique code to every user registering. The thing is that the unique code needs to be generated based on which city the user is from.
So the tables I have are:

CREATE TABLE `microreg`.`users` ( `user_id` INT NOT NULL
AUTO_INCREMENT , `user_code` CHAR(10) NOT NULL , PRIMARY KEY (`user_id`),
UNIQUE (`user_code`));

user_id is for unique identification of users in DB.<br/>
user_code is
the readable code generated for the use of users. They access their
account with that unique code.

CREATE TABLE `microreg`.`districts` ( `district_id` INT NOT NULL
AUTO_INCREMENT , `district_name` VARCHAR(50) NOT NULL , `district_code`
CHAR(4) NOT NULL , PRIMARY KEY (`district_id`), UNIQUE (`district_code`));`

This contains as about 20K districts with unique code assigned.

say,

Trichy      ITRY
Coimbatore  ICBE
Kolkata     IKOL
Delhi       IDEL
...
New York    UNYK
Washington  UWDC

So, when user registers with Trichy as district, he will be generated with

user_id   : 1
user_code : ITRY000001

second user from same city

user_id   : 2
user_code : ITRY000002

another one from New York

user_id   : 3
user_code : UNYK000001

user_code is unique with respect to district. [User with id 1 and 3 are not same]

So far, I fetched the maximum value of the selected district of the user

SELECT RIGHT(MAX(user_code),6) FROM `users` WHERE user_code LIKE 'ITRY%';

and then increment it by 1 and then add it back with district_code appended to it.

INSERT INTO `microreg`.`users` (`user_id`, `user_code`) VALUES (NULL, 'ITRY000003');

This method works perfectly when there is only one user updating at a ...

Is theren't any ways to edit app.manifest file in runtime?

check the exact database location.

Use try..catch to handle exception.

try with these:

into row = cmd .ExecuteNonQuery();
if(row>0)
MessageBox.Show( "Inserted" );
else
MessageBox. Show( "Failed" );

I need my application to start with administrator
privilege. When I do it in app.manifest:

'<requestedExecutionLevel
level="asInvoker" uiAccess="false" />'

to

'<requestedExecutionLevel
level="RequireAdministrator"
uiAccess="false" />'

I can start my application with administrator privilege.
But it starts every time the application starts. I need to
start the application with administrator privilege only once at
the first time of application usage.

Actually, I need to make the application to start with
windows instead of starting manually. So to do that I
used:

'My.Computer.Registry.LocalMachine.OpenSubK
("SOFTWARE\Microsoft\Windows\CurrentVersio
\Run", True).SetValue
(Application.ProductName,
Application.ExecutablePath)'

But it requires administrator privilege else it fails.

I have used .net's webbrowser control. Unfortunately, it
is not supporting HTML5 or Complete JavaScript. When
I googled, many said that the control depends on IE
version installed in the machine. I have installed IE10.
Though it supports HTML5 (Even I checked the same
webpage in IE10 and it worked), the webbrowser
control in my application doesn't. In some forums, they
recommended to tweak the registry. How can I do it in
every Clients machine? Is there anything that can I do?

I have used .net's webbrowser control. Unfortunately, it is not supporting HTML5 or Complete JavaScript. When I googled, many said that the control depends on IE version installed in the machine. I have installed IE10. Though it supports HTML5 (Even I checked the same webpage in IE10 and it worked), the webbrowser control in my application doesn't. In some forums, they recommended to tweak the registry. How can I do it in every Clients machine? Is there anything that can I do?

I need my application to start with administrator privilege. When I do it in app.manifest:

<requestedExecutionLevel level="asInvoker" uiAccess="false" />
to
<requestedExecutionLevel level="RequireAdministrator" uiAccess="false" />

I can start my application with administrator privilege. But it starts every time the application starts. I need to start

the application with administrator privilege only once at the first time of application usage.

Actually, I need to make the application to start with windows instead of starting manually. So to do that I used:

My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)

But it requires administrator privilege else it fails.

@diafol

Yeah mixed your idea with my situation! Thanks!

Now my table to store the results of the participant is:

ResultID (PK), QuestionID (FK), ParticipantID (FK), Answer, Score

And then retrieved based on search term.

Thanks again!

@diafol

OK, so instead of ans, use your ans1, ans2... etc.

Then this is again the way I suggested secondly in my view:

Create a table with ParticipantID, Question1, Score1, Question2, Score2,...... (Too many columns when questions count is around 200)

But @Taywin Suggested me both as inefficient method. ans1, ans2,... again creates 200 columns for 200 answers right?

@Taywin

Thanks for your suggestions. I need only the way to store test_answers. I couldn't understand "-end_date(date) -start_date(date)" what is the reason to include them? I already have the database created(as I mentioned earlier):

  1. question list MCQ - questionid, question, choice1, marks1, choice2, Marks2,..., marks4
  2. question list 2 (fillup type) - questionid, question, answer, marks

The problem runs around only how I need to structure the table to store answers only.

yeah you are right but, in MCQ for my requirement, every choice has certain marks. say for choice 1 - 0.6, choice 2 - 1, choice 3 - 0.3, choice 4 - 0.4.

Also test_results displays answer for only one user for a question. my question set contains a combination of all questions in random from mcq table and filling the blanks table. so I need only answer to be recorded for each candidate.

Reasons may be..

incorrect table name or column names or you would have misspelled them. Missing quotes also creates error. as janissantony said, post your error so we can figure it out...

I have separate table to maintain the details of all participants. Apart from this I needed to store the answers. Not all questions MCQ. Some are like filling the blanks. I don't bother about question, the thing is that I want to store the answers and score for every question answered. again questions are in a separate table.

In short, till now, I have these tables:

  1. participant details - participant info
  2. question list MCQ - questionid, question, choice1, marks1, choice2, Marks2,..., marks4
  3. question list 2 (fillup type) - questionid, question, answer, marks

As for now, I have automated to create a table with questionid, answer, score for every student who registers their name and other details.

Am creating an online examination website. I need to store the answers answered by the participants who are given a unique ID. So I will be storing ID, Answers for the question, score. So I think I have two ways to do it.

  1. Create a table for every student with columns QuestionID, Answer, Score (When 1000 participants participate what can I do here?)
  2. Create a table with ParticipantID, Question1, Score1, Question2, Score2,...... (Too many columns when questions count is around 200)

Which is the optimal way of creating the table for above scenario. Since I can understand well that MySQL can have 1000s of tables. But only limited columns.

Then fine.. Am going with ASP.NET with connected data access. Thanks!

I figured out, it was the innerexception created due to icon file missing.

I recently developed an application and it successfully ran in my computer where I developed. But when I tried to run in my client's system, it returns:

An unhandled microsoft .net framework exception occurred in Members Manager.exe [2916]

The number in the square braces appears randomly. I can't figure out what is the cause for this problem. I created the application in .NET framework 4.0 and I installed the same in client system. My other application of same framework work perfectly except this one. But this application runs perfectly in my system. I tried installing Visual Studio in client machine but all didn't work.

Your second method is tougher since, There are around 50 controls in that secondary form, so if I set the values for each of the controls again for the instance, the code is not an optimized one.

"Preview" in the sense I mean something like power point (presenter view), the secondary screen is visible in primary screen. Similarly, I pass some data to be displayed in secondary form from the primary form. And the secondary screen maynot be visible to operator, so I wanted the secondary screen to be displayed at a corner of a primary screen, in a group box.

I don't mind if it is an image or a screen capture or a form instance. I just need the secondary form to be displayed inside my primary form's group box.

Your second method is tougher since, There are around 50 controls in that secondary form, so if I set the values for each of the controls again for the instance, the code is not an optimized one.

"Preview" in the sense I mean something like power point (presenter view), the secondary screen is visible in primary screen. Similarly, I pass some data to be displayed in secondary form from the primary form. And the secondary screen maynot be visible to operator, so I wanted the secondary screen to be displayed at a corner of a primary screen, in a group box.

I don't mind if it is an image or a screen capture or a form instance. I just need the secondary form to be displayed inside my primary form's group box.

yeah.. But do I have to go for Connected or Disconnected data access in asp.net? I couldn't figure out which is best to handle the traffic.

Go for Joomla or APS.Net it would be easier I hope.

I have a contradiction in creating a website for Job seekers, confusion in choosing the language. I assume here that there would be atleast 100 people access the database at the same time to Create a new account, update their existing account and at the same time some would search the profiles of some other person for their Job. Job seekers and Job offerers are meeting together is what I mean.

Now my problem is, I designed everything in ASP.Net and while connecting to database, many people suggest me not to choose Connected data access since it can't handle such a load. And they prefer Disconnected data access. Am confused with that. Many suggest me not to go to ASP but to PHP since many popular websites like Facebook itself created in PHP. So now am left stranded in which language I should develop the site. Though am good in PHP and ASP, I prefer ASP since I could create faster. But PHP might take time to code them all and then to integrate it. But again a problem, ASP is harder to deploy.

So I request someone to suggest me to Choose either PHP or ASP. If ASP then Connected or Disconnected data access. Thanks!

There are loads of tools, Dreamweaver is the one I suggest. or Click Here

To use sqldataAdapter, you atleast need one primary key.

Are you using SQL or MS Access DB? For MS Access, you need to prefix and suffix # symbol like #10/10/2014#

Try changing Execution level in windows settings to

 <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

from

<requestedExecutionLevel  level="asInvoker" uiAccess="false" />

Am developing a two screen application where first screen resides in the user system and other screen in extended mode is directed towards a projector or another monitor. They all are working perfectly. Now my client asked me if I can preview the secondary screen onto the primary screen. I tried to display the form inside a group box using:

Dim f1 As New Form2
f1.TopLevel = False
f1.Visible = True
groupBox1.Controls.Add(f1)

and successfully displayed the form. But the problem is that whenever I make changes in the Form2 from main form, I couldn't update the form f1. I tried to place the above code inside a timer control. But the original form keeps on flickering every second (as time interval is set to 1000) and now I couldn't access the main form.

Then I tried to place the code inside a datagridview_selectionChanged event and added

groupbox1.controls.clear()

but still the f1 does not update with the form2.

I am stuck here and couldn't find a way to preview a second form inside a first form. Is there any alternative?

can I return and pass the value exactly as I did with the c# code file before?

I have created a C# code where I'll input a code to it and it returns me an encrypted entry pass code. Its all working perfectly. Now the question is that, I want to apply this code to every application I create so that only after getting the pass code, the application should run. As far as I know, I now insert that C# code file to that application and everytime am linking that code files.

For a C# application its fine, but when I create application using VB.NET, I am forced to convert the code file written in C# to VB everytime. I have heard about DLL and class files. But I am not sure how to apply this further.

Help is wanted for me as to how:

  • I should create DLL (or class) file out that C# Code file
  • How I should send and retrieve the values from that file
  • How should I make it available for both C# and VB application.

Thanks for your time.

Connect the gridview with the datasource and then in the properties, set allow user to add rows property to true(default) and you are done.