15,898,134 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 Member 8780842 (Top 55 by date)
Member 8780842
24-Jul-13 3:39am
View
I tried this sir
public string show(decimal busid,decimal totalseats,string bustype,string journeydate,string arrtime,string depttime,string source,string destination,decimal ticketprice,string bpoint,string dpoint)
{
string var;
OleDbConnection cn = new OleDbConnection("Provider=MSDAORA.1;User ID=system;password=tiger;Data Source=XE;Persist Security Infor=False");
try
{
cn.Open();
string s = "Insert into busdetails(BUS_ID,TOTAL_SEATS,BUS_TYPE,JOURNEY_DATE,ARR_TIME,DEPT_TIME,SOURCE,DESTINATION,TICKET_PRICE,B_POINT,D_POINT) values(:busid,:totseats,:bustype,:jdate,:arrtime,:dtime,:source,:dest,:tickprice,:bpoint,:dpoint)";
OleDbCommand cmd = new OleDbCommand(s, cn);
//@busid,@totseats,@bustype,@jdate,@arrtime,@dtime,@source,@dest,@tickprice,@bpoint,@dpoint
cmd.Parameters.AddWithValue("busid", Convert.ToDecimal(busid));
cmd.Parameters.AddWithValue("totseats", Convert.ToDecimal(totalseats));
cmd.Parameters.AddWithValue("bustype", bustype);
cmd.Parameters.AddWithValue("jdate", journeydate);
cmd.Parameters.AddWithValue("arrtime", arrtime);
cmd.Parameters.AddWithValue("dtime", depttime);
cmd.Parameters.AddWithValue("source", source);
cmd.Parameters.AddWithValue("dest", destination);
cmd.Parameters.AddWithValue("tickprice", Convert.ToDecimal(ticketprice));
cmd.Parameters.AddWithValue("bpoint", bpoint);
cmd.Parameters.AddWithValue("dpoint", dpoint);
cmd.ExecuteNonQuery();
var="success";
}
catch (OleDbException e1)
{
Console.Write(e1.Message);
Console.Write(e1.StackTrace);
var = e1.Message;
}
cn.Close();
return var;
}
}
table format is
bus_id not null nummber(6,2)
total_seats number
bus_type varchar2<4000>
journey_date varchar2<4000>
arr_time varchar2<4000>
dept_time varchar2<4000>
source varchar2<4000>
destination varchar2<4000>
ticket_price number(5,2)
b_point varchar2<4000>
d_point varchar2<4000>
I am getting this error
ORA 0:01008: Not all variables bound
Member 8780842
23-Jul-13 13:37pm
View
country is passed as parameter
Member 8780842
8-Apr-13 8:19am
View
Thank you so much i did my exam well :) :) :) thank youuuuuuuuuu so much :)))))))))))))
Member 8780842
7-Apr-13 5:44am
View
count(*) count ok what does * means ?
Member 8780842
7-Apr-13 5:28am
View
in this query
SELECT c.cus_name, m.mem_no FROM customer c
JOIN membership m ON m.cus_no = c.Cus_no
can we change the order like this ?
SELECT c.cus_name, m.mem_no FROM membership m
JOIN customer c ON c.cus_no = m.Cus_no
Member 8780842
7-Apr-13 5:00am
View
thank you :)
Member 8780842
7-Apr-13 4:40am
View
(and the name of a table and a field is wrong)
cant understand this :(
Member 8780842
26-Mar-13 12:31pm
View
sir can you help me with this command today in exam i got this question i tried to my extent but i cant :(
we have three tables customer , item and sales
customer table has (customer_id(primary key) and customer_name)
item table has (item_id(primary key), item_name, item_price)
sales table has (bill_no(primary key), bill_id , customer_id, item_id, quantity_sold)
now i have to list the customer details whos purchase cost >200
(hint:cost as (item_price*quantity_sold) for that particular customer)
can you help me with this please sir
Member 8780842
26-Mar-13 12:18pm
View
Ya sir thank you i tried all your sql commands really brilliant answers thank you :) very much
Member 8780842
26-Mar-13 11:57am
View
Sir i used this sql command
select top 3 * from Result order by Test3Mark desc, TotalMark desc, Test2Mark desc, Test1Mark desc;
it is working fine thank you :)
Member 8780842
26-Mar-13 11:27am
View
sorry sir first i will get the max test3mark to display and when two persons test3mark matches then i have to check the totalMarks . and display them sir
i can figure out from your answer the first part to find the max test3mark
select top 1 * from result order by test3mark dec
now when two persons test3mark matches i have to check whose totalmark is greater and display them first how can i modify this sql command sir
Member 8780842
26-Mar-13 11:10am
View
I have to thank you :) Thank you so much :)
Member 8780842
26-Mar-13 11:06am
View
If both the rows have totalmark same then I have to select based on the avg test1mark test2mark test3mark how can i write the sql query :(
Member 8780842
26-Mar-13 10:57am
View
"Column 'Result.UserName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."
Member 8780842
17-Mar-13 3:57am
View
Michael Haephrati there please tell me how can I do it
Member 8780842
16-Mar-13 17:09pm
View
string tm1 = "Select Test1Time from Result where UserName='" + ref1.ToString() + "'";
string tm2 = "Select Test2Time from Result where UserName='" + ref1.ToString() + "'";
string tm3 = "Select Test3Time from Result where UserName='" + ref1.ToString() + "'";
SqlCommand tkk1 = new SqlCommand(tm1, con);
DateTime tm11 = Convert.ToDateTime(tkk1.ExecuteScalar().ToString());
SqlCommand tkk2 = new SqlCommand(tm2, con);
DateTime tm22 = Convert.ToDateTime(tkk2.ExecuteScalar().ToString());
SqlCommand tkk3 = new SqlCommand(tm3, con);
DateTime tm33 = Convert.ToDateTime(tkk3.ExecuteScalar().ToString());
now I have got three time in tm11 and tm22 tm33 . i hav to add them three
Member 8780842
16-Mar-13 17:01pm
View
and in that Test1Time Test2Time and Test3Time the values will be like this "00:09:02" format
Member 8780842
16-Mar-13 17:00pm
View
Now i used this code as per your suggestions
string tm1 = "Select Test1Time from Result where UserName='" + ref1.ToString() + "'";
string tm2 = "Select Test2Time from Result where UserName='" + ref1.ToString() + "'";
string tm3 = "Select Test3Time from Result where UserName='" + ref1.ToString() + "'";
SqlCommand tkk1 = new SqlCommand(tm1, con);
DateTime tm11 = Convert.ToDateTime(tkk1.ExecuteScalar().ToString());
SqlCommand tkk2 = new SqlCommand(tm2, con);
DateTime tm22 = Convert.ToDateTime(tkk2.ExecuteScalar().ToString());
SqlCommand tkk3 = new SqlCommand(tm3, con);
DateTime tm33 = Convert.ToDateTime(tkk3.ExecuteScalar().ToString());
TimeSpan totaltime = (tm11.Add(tm22.Add(tm33)));
error messages
1.Error 31 The best overloaded method match for 'System.DateTime.Add(System.TimeSpan)' has some invalid arguments D:\Project march 16 2013\Project march 2 2013\Take3.aspx.cs 3252 40 D:\Project march 16 2013\Project march 2 2013\
2.Error 32 Argument 1: cannot convert from 'System.DateTime' to 'System.TimeSpan' D:\Project march 16 2013\Project march 2 2013\Take3.aspx.cs 3252 49 D:\Project march 16 2013\Project march 2 2013\
3.Error 30 Argument 1: cannot convert from 'System.DateTime' to 'System.TimeSpan' D:\Project march 16 2013\Project march 2 2013\Take3.aspx.cs 3252 40 D:\Project march 16 2013\Project march 2 2013\
4.Error 29 The best overloaded method match for 'System.DateTime.Add(System.TimeSpan)' has some invalid arguments D:\Project march 16 2013\Project march 2 2013\Take3.aspx.cs 3252 31 D:\Project march 16 2013\Project march 2 2013\
Member 8780842
16-Mar-13 16:49pm
View
string tm1 = "Select Test1Time from Result where UserName='" + ref1.ToString() + "'";
string tm2 = "Select Test2Time from Result where UserName='" + ref1.ToString() + "'";
string tm3 = "Select Test3Time from Result where UserName='" + ref1.ToString() + "'";
SqlCommand tkk1 = new SqlCommand(tm1, con);
DateTime tm11 = DateTime.Parse(tkk1.ExecuteScalar);
SqlCommand tkk2 = new SqlCommand(tm2, con);
TimeSpan tm22 = TimeSpan.Parse(tkk2.ToString());
SqlCommand tkk3 = new SqlCommand(tm3, con);
TimeSpan tm33 = TimeSpan.Parse(tkk3.ToString());
TimeSpan totaltime = (tm11.Add(tm22.Add(tm33)));
string insCmd13 = "Update Result Set Totaltime=@Test3Mark,totalmark=@Test3Time Where UserName=@UserName ";
SqlCommand insertUser13 = new SqlCommand(insCmd13, con);
insertUser13.Parameters.AddWithValue("@UserName", ref1.ToString());
insertUser13.Parameters.AddWithValue("@Test3Mark", totalmark.ToString());
insertUser13.Parameters.AddWithValue("@Test3Time", totaltime);
Member 8780842
16-Mar-13 16:43pm
View
Then also it is showing error in executescalar
Member 8780842
16-Mar-13 16:36pm
View
How to modify the sqlquery to get in time value and then add that please
Member 8780842
11-Mar-13 11:42am
View
Deleted
yes
Member 8780842
2-Mar-13 2:40am
View
:) accepted :)
Member 8780842
26-Feb-13 12:47pm
View
Thank u :)
got it :) :)
Member 8780842
25-Feb-13 10:50am
View
Thank you :)
Is this fine :)
int x=Int.Parse(textbox2.Text);
cmd.CommandText = "Update studtable set studentmark=studentmark+@studentmark where studentname=@studentName"
cmd.Parameters.AddWithValue("@studentName", textbox1.Text);
cmd.Parameters.AddWithValue("@studentmark", x);
Member 8780842
25-Feb-13 10:49am
View
@ThePhantomUpvoter why ;)
Member 8780842
25-Feb-13 10:38am
View
This should work fine right :) :) :)
int x=convert.int32(textbox2.Text);
cmd.CommandText = "Update studtable set studentmark=studentmark+@studentmark where studentname=@studentName"
cmd.Parameters.AddWithValue("@studentName", textbox1.Text);
cmd.Parameters.AddWithValue("@studentmark", x);
Member 8780842
25-Feb-13 10:35am
View
ryanb31 no other go i hav to see that ;)
Member 8780842
25-Feb-13 10:33am
View
Another one doubt in the database table definition I have kept studentmark as int type and so when i am updating is it right to use like this
cmd.CommandText = "Update studtable set studentmark=studentmark+@studentmark where studentname=@studentName"
cmd.Parameters.AddWithValue("@studentName", textbox1.Text);
cmd.Parameters.AddWithValue("@studentmark", convert.int32(textbox2.Text));
Member 8780842
25-Feb-13 10:32am
View
Thank you so much :) :) :)
Member 8780842
25-Feb-13 10:28am
View
sorry sorry mark is not updated :(
Member 8780842
25-Feb-13 10:26am
View
is this possible ryanb31
cmd.CommandText = "Update studtable set studentmark=studentmark+@studentmark where studentname=@studentName"
cmd.Parameters.AddWithValue("@studentName", textbox1.Text);
cmd.Parameters.AddWithValue("@studentmark", textbox2.Text);
Member 8780842
24-Feb-13 1:27am
View
THank you :) How to give that sir
Member 8780842
23-Feb-13 23:58pm
View
Mine is windows 8 sqlserver database and the connection string is
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionString"].ConnectionString);
web.config file
<add name="RegConnectionString" connectionstring="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True" providername="System.Data.SqlClient">
<system.web>
<compilation debug="true" targetframework="4.0">
Member 8780842
23-Feb-13 15:09pm
View
yes sorry
Member 8780842
23-Feb-13 4:12am
View
richch one small help now i have created the radiobuttonlist boxes dynamically ....but now i have to cal the total marks from the selected options ,in my examination system . i used the following code in one function cal() and call it the cal method is as follow but i am getting the score as zero only i dont know where is the problem in my code :(
protected void cal()
{
int cs = 0;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionString"].ConnectionString);
con.Open();
TimeSpan time = (Session["CountdownTimer"] as CountDownTimer).TimeLeft;
TimeSpan time2 = TimeSpan.Parse("00:10:00");
string timel = time2.Subtract(time).ToString();
string ref1 = Session["New"].ToString();
SqlCommand cmd = new SqlCommand("select * from questions where tname='Prelim'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "questions");
DataRow DR = ds.Tables[0].Rows[0];
for (int i = 1; i <= ds.Tables[0].Rows.Count; i++)
{
SqlCommand cmd1 = new SqlCommand("select cans from questions where tname='Prelim' and questionno='" + i + "'", con);
SqlDataAdapter daa = new SqlDataAdapter(cmd1);
DataSet dss = new DataSet();
daa.Fill(dss, "questions");
DataRow DRR = dss.Tables[0].Rows[0];
rbl.ID = "rbl" + i;
if (rbl.SelectedIndex > -1)
{
string gota = DRR[0].ToString();
string selval = rbl.SelectedItem.Text;
if (gota.Equals(selval))
{
cs = cs + mk;
}
else { cs = cs - 1; }
}
else
{
cs = cs + 0;
}
}
string insCmd1 = "Insert into Result(UserName,Test1Mark,Test1Time) values(@UserName,@Test1Mark,@Test1Time) ";
SqlCommand insertUser = new SqlCommand(insCmd1, con);
insertUser.Parameters.AddWithValue("@UserName", ref1.ToString());
insertUser.Parameters.AddWithValue("@Test1Mark", cs.ToString());
insertUser.Parameters.AddWithValue("@Test1Time", timel.ToString());
insertUser.ExecuteNonQuery();
con.Close();
}
Member 8780842
23-Feb-13 1:29am
View
I got it :) :) :) I used Label.text and added it dynamically :) Thank you richcb thank you very much for teaching me this dynamic concept that i forgot to implement at this time :) :) :)
Member 8780842
23-Feb-13 1:06am
View
Thank you Working fine :) :) :)
I modified it to
SqlCommand cmd1 = new SqlCommand("select ans1,ans2,ans3,ans4,cans from questions where tname='Prelim' and questionno='" + i + "'", con);
SqlDataAdapter daa = new SqlDataAdapter(cmd1);
DataSet dss = new DataSet();
daa.Fill(dss, "questions");
DataRow DRR = dss.Tables[0].Rows[0];
Response.Write(i + DRR[4].ToString());
RadioButtonList rbl = new RadioButtonList();
rbl.ID = "rb1" + i;
rbl.Items.Clear();
rbl.Items.Add(DRR[0].ToString());
rbl.Items.Add(DRR[1].ToString());
rbl.Items.Add(DRR[2].ToString());
rbl.Items.Add(DRR[3].ToString());
form1.Controls.Add(rbl);
}
Working fine and great thank youuuuuuuuuuuu very much richcb and another doubt in between i have to display questions in numbered order So i added the line "Response.Write(i + DRR[4].ToString());" it was displaying all the questions in two lines and den all the radiobuttonlist :(
Member 8780842
22-Feb-13 7:25am
View
Thank you very much but small doubt you have used Form1.Controls.Add .. I am using asp.net will it show an error
Member 8780842
21-Feb-13 8:05am
View
Ya thank you sir i got it . I should get these details in the SQLManagementStudio right :) thank you
Member 8780842
21-Feb-13 7:50am
View
In this myServerAddress and userid and password how to set that please sir :(
Member 8780842
21-Feb-13 7:45am
View
No sir i am a beginner i was asked to do a project in a new language and i took and did without hesitation . i saw some tutorial and developed a program fully . In that tutorial they used a sqldatasource and added a connectionString so i am not aware of that :( sorry to disturb you . since i am a beginner i am confused a lot :(
Member 8780842
21-Feb-13 7:40am
View
Yes Sandeep Mewara how should that string look like if it is to be accessed via network
syntax or any of that kind ? please
Member 8780842
21-Feb-13 7:34am
View
since i used sqldatasource while using that i got one connectionstring and so i used that to connect to the database but now since the database have to be in the server how to modify it . please
And another thing Sandeep Mewara your solution to keep database in network will solve my problem na orelse i have to perform any other thing or improvements too :( please
Member 8780842
21-Feb-13 7:27am
View
I cant remove this solution i did this by mistake sorry
Member 8780842
21-Feb-13 7:25am
View
How Do I have to modify the database connection string :( sorry i am not aware of how to do it :( my old connection string is like this
SqlConnection con = newSqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionString"].ConnectionString);
Member 8780842
20-Feb-13 14:48pm
View
i have updated my question
Member 8780842
20-Feb-13 14:30pm
View
Can you please help me
Member 8780842
20-Feb-13 14:06pm
View
Ya you are right :( but i read that i cant figure it out how that can be applied in my scenario :( . i have got the total count of questions for one round by query and stored in totalQs .
In the database i have the fields as tname,Question, ans1,ans2,ans3,ans4,cans
tname round1
question is the question
ans1,2,3,4 are the choices
cans is the correct ans
Now i want to show them in this order
//question1
//choices of question1
//question2
//choices of question2
.. so on
how can i display them in this order :( i have tried many times and spent most of my sleep in this project :( please help me
Member 8780842
20-Feb-13 14:04pm
View
Ya you are right :( but i read that i cant figure it out how that can be applied in my scenario :( . i have got the total count of questions for one round by query and stored in totalQs .
In the database i have the fields as tname,Question, ans1,ans2,ans3,ans4,cans
tname round1
question is the question
ans1,2,3,4 are the choices
cans is the correct ans
Now i want to show them in this order
//question1
//choices of question1
//question2
//choices of question2
.. so on
how can i display them in this order :( i have tried many times and spent most of my sleep in this project :( please help me
Member 8780842
20-Feb-13 13:53pm
View
richcb: rb1 is the radiobuttonlist . whether it will be posted in the web form directly
Member 8780842
20-Feb-13 13:43pm
View
yes but how to make a radiobuttonlist dynamically where it will be created how to create it dynamically :( can u provide me a code snippet pls
Member 8780842
20-Feb-13 13:24pm
View
sandeep mewara yes
Member 8780842
20-Feb-13 13:16pm
View
this is the connection i used
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["RegConnectionString"].ConnectionString);
Member 8780842
20-Feb-13 13:08pm
View
Deleted
ya :)
Show More