15,885,767 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by 2012programmer (Top 38 by date)
2012programmer
30-Apr-14 1:20am
View
I have one more question related to SQL-database sorting. I have table with 3 columns(Empcode, Department, CollegeName).Department has five different values (ECE, EEE, ..etc). Kindly let me know that how to sort department wise. For Example, I need all EEE department employees in the first then other employees of same college and then other college employees..
2012programmer
28-Apr-14 9:49am
View
Thanks. This solution is working perfectly.
2012programmer
28-Apr-14 9:35am
View
Yes, I have "Name" in my templatefield of gridview. It is displaying all the data, but the problem occuring while I am updating it.
2012programmer
6-Jan-14 6:32am
View
How to give permissions to default user?? I am also getting the same error..
2012programmer
2-Jan-14 7:56am
View
Thank you karthik, It is working perfectly
2012programmer
2-Jan-14 7:40am
View
thank you...I got it, but how do I check this..(I want to give the permission to two different users in some pages and three users in some pages)?
2012programmer
26-Dec-13 15:07pm
View
I need the all the studentids sorted by maximumu avergestudents....
1. Professor=101 has 4 lectureids=401,411,412,415, and each lectureid has various no. of students(25,26,20,19)..
The averagecount=Totalno.ofstudents(25+26+20+19)/no.of distinct lectureids(4)=23
2. Professor=102 has 3 lectureids=416,417,419 and each lectureid has various no. of students(20,19,21)..
The averagecount=Totalno.ofstudents(20+19+21)/no.of distinct lectureids(3)=20
....
Like this there will be 60 professors, with different averagecount...My table should be sorted in a way that, If professor=119 has averagecount=24(for ex: highest)..then all the students of this professor should appear first..
2012programmer
26-Dec-13 2:30am
View
After filtering how to get the value from dataview..?
dv1.Table.Rows[k]["roomno"]);
When I use this statement I am getting all the records of dataview..But My requirement is, The value must be from the filtered data..
2012programmer
25-Nov-13 3:41am
View
but this procedure I want to do it from ASP.net interface using c#.net...
2012programmer
25-Nov-13 0:33am
View
Yeah, I have tried with General datatype and Text data type also...
2012programmer
24-Nov-13 7:46am
View
Thanks alot for your help..appreciated your help...
2012programmer
24-Nov-13 7:00am
View
yes I have defined as "Text"...still it is not working..
2012programmer
24-Nov-13 6:23am
View
the table is already exist, and I am using Import wizard of SQL server management studio, I am able to import it, but If the "roomno." column data is not starting with "G" then it is taking "NULL"(instead of no.1234)..
2012programmer
24-Nov-13 6:22am
View
the table is already exist, and I am using Import wizard of SQL server management studio, I am able to import it, but If the "roomno." column data is not starting with "G" then it is taking "NULL"(instead of no.1234)..
2012programmer
24-Nov-13 5:47am
View
But, the problem here is, I am importing data from an MS-Excel file. I am able to insert the data from sql server mangement studio, but I am unable to import it from excel, bcoz of this data typ issue..
2012programmer
11-Nov-13 11:24am
View
Thank you very for your great support.
2012programmer
11-Nov-13 11:23am
View
Is there any option for random generation in C# or SQL server
2012programmer
11-Mar-13 17:29pm
View
Thank you Mr. Sandip, It is working very fine. The hyperlink you have provided is very useful for me.
I have 2 more queries, kindly help me in this regard. 1. How to publish this asp.net application. (Is there any step by step article is available ?). 2. After publishing this application If I want to change my connection string in web.config file, How Can I do this (There is no visual studio in Host system).
2012programmer
11-Mar-13 13:12pm
View
I have an application form, in this form there is some static content and dynamic content available. This dynamic content will be changed based on database records. For each row of a table in database one page should be published. " Print 20 pages means If there are 20 rows in that table then 20 pages should be printed. Like Mail merge feature in MS-Word, some content is static and some content is dynamic but when we publish this static content is repeated for each record. Thank you.
2012programmer
30-Jan-13 3:44am
View
Using ajax is looking difficult for me, is there any way to do this. another requirement is stop submitting if there 20 records per a course each day.
2012programmer
26-Jan-13 2:35am
View
I am inserting the record when a user click on button. But Iam checking the userid is correct or not in text change event. In text change event only can I check the user is already registered or not.
2012programmer
24-Jan-13 15:32pm
View
I am planning a training program for employees, for that employees will register on a asp.net web page. If there 1500(for example), but the training program is designed for 50 employs only.
My requirement: Somebody can fill my database with garbage values. To avoid this, I have EIDS table in which all employ ids are stored, If a user try to enter gargabe value, then it will check with EIDS table then it will allow you to enter other details. This is working fine. But another requirement if an employ try to re-register it is giving "Server Error", Instead of server error can we provide an alert box with "already registered"
2012programmer
23-Jan-13 15:19pm
View
First of all I thank you for your help.
For example, there is 1500 employees. These employee id's are stored in a table(EIDS), But My requirement is to register only 50 employes(EmpRegister table) from those 1500 employees. I need two types of validations, 1. The user entered id must be present in EIDS table, 2. EmpRegister table should not include duplicate records(For this purpose "EID" column of EmpRegister table has a primary key- this is working fine, but if there is duplicate value try to insert into database table- it is giving Server Error in the browser, this is not looking good in the browser, what I need is just give an alert message that "Already Registered".
2012programmer
18-Jan-13 8:20am
View
Thank You 'Naman'. I dont have much idea about DB and foriegn keys. Can you give me detail code. One more problem is, Initially if there is no records in my database table- then it should show all the list(Monday,Tuesday,....Sunday).
2012programmer
16-Jan-13 15:50pm
View
References: d1=dropdownlist1
r1=radiobutton1
r2=radiobutton2
Code:
protected void Page_Load(object sender, EventArgs e)
{
DataTable records = new DataTable();
string myConnection = "Data Source=server;Initial Catalog=college;User ID=sa;Password=123";
SqlConnection con = new SqlConnection(myConnection);
con.Open();
SqlCommand sqlCommand = new SqlCommand();
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.CommandText = "GetListRecordNotHavingTenCount";
sqlCommand.Connection = con;
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand); sqlDataAdapter.Fill(records);
// d1.DataSource = records;
// d1.DataValueField = "Id";
// d1.DataTextField = "Lecturetimings";
//this.d1.DataBind();
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (d1.SelectedIndex)
{
case 0:
r1.Visible = false;
r2.Visible = false;
break;
case 1:
r1.Visible = false;
r2.Visible = false;
r1.Text = "C Language";
r2.Text = "C ++";
r1.Visible = true;
r2.Visible = true;
break;
case 2:
r1.Visible = false;
r2.Visible = false;
r1.Text = "Basic Hardware";
r1.Visible = true;
break;
case 3:
r1.Visible = false;
r2.Visible = false;
r1.Text = "Networking";
r1.Visible = true;
break;
case 4:
r1.Visible = false;
r2.Visible = false;
r1.Text = "Adobe Flash";
r2.Text = "Adobe Photoshop";
r1.Visible = true;
r2.Visible = true;
break;
case 5:
r1.Visible = false;
r2.Visible = false;
r1.Text = "C#.Net";
r1.Visible = true;
break;
case 6:
r1.Visible = false;
r2.Visible = false;
r1.Text = "Basic Hardware";
r1.Visible = true;
break;
case 7:
r1.Text = "Adobe Flash";
r2.Text = "Networking";
r1.Visible = true;
r2.Visible = true;
break;
}
}
protected void Button1_Click1(object sender, EventArgs e)
{
String myConnection = " Data Source=server;Initial Catalog=college;User ID=sa;Password=123";
SqlConnection con = new SqlConnection(myConnection);
SqlCommand cmd;
con.Open();
cmd = new SqlCommand(@"INSERT INTO [dbo].[Register]([Sname],[Email]
,[ContactNo],[Activity],[Lecturetimings])
VALUES('" + name.Text + "','" + email.Text + "','" + contact.Text + "','" + r1.Text + "','"+d1.SelectedValue+"')", con);
cmd.ExecuteNonQuery();
con.Close();
ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('SuccessFully Submitted');", true);
d1.SelectedIndex = 0;
name.Text = "";
email.Text = "";
contact.Text = "";
CheckBox1.Checked = false;
r1.Visible = false;
r2.Visible = false;
}
Thank you Naman Kumar.
2012programmer
16-Jan-13 8:56am
View
what is "tt" here.
2012programmer
16-Jan-13 7:44am
View
What is "ii" here in the above code.
2012programmer
16-Jan-13 6:46am
View
There is one more question, If I create LectureTimings table,then on one-day(ex:Saturday) there are 2 courses(ex:VB,ASP).How can I enter this type of situation in table.
2012programmer
16-Jan-13 6:36am
View
Thanks "Kishor". As I am new to programming can you let me know with the code to generate radio buttons dynamically.
2012programmer
16-Jan-13 4:01am
View
Deleted
I am creating a web based application (Student Registration Form). In this Web Page I have 1 dropdown list (which shows the lecturetimings like Saturday, Sunday, Monday, Tuesday,........etc). After selecting a list item(ex: Saturday It will show availble courses as Radio buttons (Example:MS-Office,C#.Net). In the selected index change event of drop down list-I have written a switch case:
for every different case
case 0: r1.Visible = false; r2.Visible = false; break;
case 1: r1.Visible = false; r2.Visible = false; r1.Text = "MS-Office"; r1.Visible = true; break;
case 2: r1.Visible = false; r2.Visible = false; r1.Text = "Hardware & Networking"; r2.Text="C#.net"; r1.Visible = true; r2.Visible = true; break; ........... Upto case7 written.
Then I have some text boxes for (StudentName, EmailId, ContactNo.& address0 I have checkbox(I agree terms & Conditions) There is a submit button( on clicking this, the information wil be saved in data base table registration(StudentName,EmailId,ContactNo.,Address, Lecturetimings, Course)Ex:(John, john@john.com, 9999999999, India, Saturday,MS-Office). Now My requirement is if there 10 records with Saturday then in the dropdown list saturday should not be shown. Thanks in advance for taking pains for me.
2012programmer
16-Jan-13 3:29am
View
Ok.This is working well.It showing 2 items in dropdown list as there entries with Saturday and Sunday.Intially if there are no records in the table then it should show all the items in the list like (Monday,.....Saturday).
And One more problem is its not showing the radio buttons when I select any list item(after applying this code)
2012programmer
16-Jan-13 3:12am
View
I am creating a web based application (Student Registration Form). In this Web Page I have 1 dropdown list (which shows the lecturetimings like Saturday, Sunday, Monday, Tuesday,........etc). After selecting a list item(ex: Saturday It will show availble courses as Radio buttons (Example:MS-Office,C#.Net). In the selected index change event of drop down list-I have written a switch case: for every different casecase 0:
r1.Visible = false;
r2.Visible = false;
break;
case 1:
r1.Visible = false;
r2.Visible = false;
r1.Text = "MS-Office";
r1.Visible = true;
break;
case 2:
r1.Visible = false;
r2.Visible = false;
r1.Text = "Hardware & Networking";
r2.Text="C#.net";
r1.Visible = true;
r2.Visible = true;
break;
...........
Upto case7 written.
Then I have some text boxes for (StudentName, EmailId, ContactNo.& address0
I have checkbox(I agree terms & Conditions)
There is a submit button( on clicking this, the information wil be saved in data base table registration(StudentName,EmailId,ContactNo.,Address, Lecturetimings, Course)Ex:(John, john@john.com, 9999999999, India, Saturday,MS-Office).
Now My requirement is if there 10 records with Saturday then in the dropdown list saturday should not be shown. Thanks in advance for taking pains for me.
2012programmer
16-Jan-13 2:53am
View
What is "Id" here in thi code?. I am getting this error "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Id'."
2012programmer
16-Jan-13 2:26am
View
Hi, Thank you once again for your great support. Kindly let me know how to append these "records" table values as dropdown list item. Initially if there are no records in the database, then what values it will append to the dropdown list.
2012programmer
15-Jan-13 8:24am
View
Kindly let me know the code for stored procedure and C# code. My table name is "Register", Column Name is "Lecturetime", List Items are(1.Monday,2.Tuesday, 3.Wednesday, 4.Thursday, 5.Friday, 6.Saturday, 7.Sunday). Thanks in advance "Faisaladians".
2012programmer
15-Jan-13 7:58am
View
Yes Exactly. Kindly let me know the code for stored procedure and C# code. My table name is "Register", Column Name is "Lecturetime", List Items are(1.Monday,2.Tuesday, 3.Wednesday, 4.Thursday, 5.Friday, 6.Saturday, 7.Sunday). Thanks in advance "Faisaladians".
2012programmer
15-Jan-13 7:17am
View
Thank you very much Every body.This code is working.I need some more help. I was saving the selected list items of a dropdown list into column of a database table.My requirement is to count the records with each "list item". If there are 10 records with one "listitem" then that listitem should be removed from the dropdown list.
The above code is working fine for one list item, But I need for 7 list items. Do I need to write the stored procedure or I need to write select statements 7 times.
2012programmer
15-Jan-13 3:35am
View
Thanks Vani Kulkarni for early response.Kindly let me know how to write a stored procedure. I am new to programming. Can any body tell complete code. Thanks in advance.
Show More