|
I've set up a 'quiz' site and have used a RadioButtonList to answer the questions, the problem I have is that for each question there are 5 possible answers, each answer is held in a column in my database (SQL) but I can only bind the RadioButtonList to one column.
Does anybody know how to set the text for each ListItem with data from multiple columns in an SQL database?
That's the SQL DataSource if it helps?
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:ConnectionString %>" xmlns:asp="#unknown">
SelectCommand="SELECT QuestionID, QuestionImage, QuestionText, Answer1, Answer3, Answer2, Answer4, Answer5, CorrectAnswer, QuestionOrder FROM Questions WHERE (TestID = @TestID) ORDER BY QuestionOrder">
<selectparameters>
<asp:sessionparameter defaultvalue="0" name="TestID" sessionfield="TestID" />
</selectparameters>
</asp:sqldatasource>
Thanks a lot!
|
|
|
|
|
You need to change your SQL or write code to turn your 5 columns into five objects in an array ( for example ), to create a valid data source.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Change the database itself or the code in the page? Could you give me an example of what you're suggesting? I've been going over other sites that "explain" how to change the RadioButtonList to allow the text value to be changed but none of it's working, I'm so lost with this it's stupid
|
|
|
|
|
List<string> list = new List<string>();
list.Add((string)myRow[1]);
list.Add((string)myRow[2]);
list.Add((string)myRow[3]); // whatever columns in your row contain the answers
myRadioButtons.DataSource = list;
myRadioButtons.DataBind();
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Thanks ever so much! I'll let you know how it goes!
|
|
|
|
|
http://lh5.ggpht.com/_BnCCXr6jD8U/Sdclyw8eVXI/AAAAAAAAAC8/5xHWT_MQY_s/s400/image1.jpg[^]
please check out that link..
I have swf file in my page i also used ajax autocomplete in my textbox..when autocomplete done & dropdownlist comes at that time it will show back side of swf..how to put it in front side..the dropdownlist comes only when i write some char on textbos as i used autocomplete..so tell me how to put it front side or how to put swf back side.....mail me on bhrugu143@yahoo.co.in
|
|
|
|
|
bhrugu4me wrote: mail me on bhrugu143@yahoo.co.in
This makes you a moron
1 - now spam bots will find this email and spam you
2 - any response on these boards is emailed to you
3 - why would we help you if you're not interested enough in our community to read the forum to see replies ?
The SWF control is being rendered on top of the HTML. There is no way around this, you need to redesign how your page is laid out. If you had a basic understanding of waht ASP.NET is and does, what AJAX does and doesn't bring to the equation, and how a plug in like Flash works, you'd see why this would be the case.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
What have you tried ? How have you referred to your textbooks and searched google to come up with an answer ? Why should we write your code for you, if you show no signs of having tried to write it yourself ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Rent a coder.
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
that will cost you One Lakh Crore?
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Yusuf.A wrote: that will cost you One Lakh Crore?
in $ or Rs.
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
I'm generous, even though $ is preferred, willing to accept Rs too. Heck, I take any currency for that much money, except Zim$
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
i updating the content (column F2) of exel sheet with this code
this is working fine In My Company LAn.
Like i access this code from server And from client Pc I can Update It Using Code Given Below
but when i wrote this code at Client server ,And Trying to do the same , it gives the error :
Operation Must use an update able Query
Code Is given below
Protected Sub Call1()
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\OrderHeader.xls;Extended Properties=""Excel 8.0;HDR=YES;"""
Dim factory As DbProviderFactory = DbProviderFactories.GetFactory("System.Data.OleDb")
Using connection As DbConnection = factory.CreateConnection()
connection.ConnectionString = connectionString
Using command As DbCommand = connection.CreateCommand()
command.CommandText = "Update [OrderHeader$] set F2= 'Used'"
connection.Open()
command.ExecuteNonQuery()
End Using
End Using
End Sub
i need it on urgent basis. Plz ..........
Raghvendra
|
|
|
|
|
This code is accessing a local file which is not within your ASP.NET website. You don't have that access, you need for your excel file to be on the server, below the root directory of your web app.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
the given code is passwordrecovey1_sendmail()
protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
MailMessage objMailMessage = new MailMessage();
System.Net.Mail.MailAddress objFrom = new MailAddress("server@gmail.com", DisplayName);
objMailMessage.From = objFrom;
objMailMessage.To.Add("grk.gummadi@gmail.com");
objMailMessage.Subject = Subject;
objMailMessage.Body = HtmlBody;
if (Cc.Trim().Length > 0)
{
objMailMessage.CC.Add(Cc);
}
if (Bcc.Trim().Length > 0)
{
objMailMessage.Bcc.Add(Bcc);
}
SmtpClient smtp = new SmtpClient(smtpServerIp, portNumber);
if (authenticateUser.Length > 0 && authenticatePassword.Length > 0)
{
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential(authenticateUser, authenticatePassword);
smtp.Send(objMailMessage);
}
else
{
smtp.UseDefaultCredentials = true;
smtp.Send(objMailMessage);
}
}
error message is
CS0104: 'MailMessage' is an ambiguous reference between 'System.Web.Mail.MailMessage' and 'System.Net.Mail.MailMessage'
plz solve this problem and any other problems
give me quick reply
thank you in advance
|
|
|
|
|
Are you illiterate ? The message means what it says. Buy a C# book and learn some C#, then come back to us when you know some basics. You have two namespaces scoped which both have a MailMessage class in them, so you need to be explicit about which one you are using.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi All,
I want To set Data source for ultrawebgrid by Ajax in javascript...
but i can't do that,,
please can any body help me to solve this problem ....
thanks all
|
|
|
|
|
I checked and there is no ultrawebgrid in the .NET framework. I suggest you ask whoever wrote the control. Also, do you really want to use AJAX, or do you want to use a library that hides AJAX from you, like the ASP.NET AJAX library ? Be specific when asking the people who know something about the control you're using.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
exactly what is your need? there is no such thing as CG said.
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
i am using vb6.
i have to make a application as stated below:
1)data will be in UDP format &
2)this data is send to the another pc which is NOT in the LAN.
As i have used winsock control for udp and its working fine within a LAN but not working in remote PC behind LAN.
its urgent.
thanks in advance.
|
|
|
|
|
You are an idiot.
1 - VB6 is outdated and unsupported. It was always a bad language, now it's a terrible choice
2 - you cannot write VB6 code in ASP.NET, so why on earth did you ask this here ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
bellow my code
protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
//PasswordRecovery1.Visible = true;
string email = PasswordRecovery1.UserNameLabelText.ToString();
MailMessage message = new MailMessage();
SmtpClient smtpClient = new SmtpClient();
string cclist;
string msg = string.Empty;
try
{
MailAddress fromAddress = new MailAddress();
message.From =new MailAddress("info@server.com");
message.To.Add(new MailAddress("to adress"));
if (cclist != null && cclist != string.Empty)
message.CC.Add(cclist);
message.Subject = subject;
message.IsBodyHtml = true;
message.Body = body;
smtpClient.Host = "mail.server.com";
smtpClient.Port = 25;
smtpClient.UseDefaultCredentials = true;
smtpClient.Credentials = new System.Net.NetworkCredential("info@server.com", "password");
smtpClient.Send(message);
msg = "sucessfully";
}
catch (Exception e)
{
msg = e.Message;
}
return msg;
}
the errror message is
No overload for method 'MailAddress' takes '0' arguments
|
|
|
|
|
grkrishna wrote: No overload for method 'MailAddress' takes '0' arguments
It`s obvious and the error is self explanatory. The MailAddress class constructor expects a parameter that you need to pass in. And i guess there no need for this line which causes the error as it is referred nowhere in your code.
grkrishna wrote: MailAddress fromAddress = new MailAddress();
When you fail to plan, you are planning to fail.
|
|
|
|