Einstein’s Riddle
Category: Latest Asked Questions | 0 views | Add a Comment
In each house lives a different nationality.
These 5 owners drink a certain beverage, smoke a certain brand of cigar and keep a certain pet.
No owners have the same pet, smoke the same brand of cigar, or drink the same beverage.
The CLUES:
The Brit lives in the Red house.
The Swede keeps dogs as pets.
The Dane Drinks tea.
The Green House is on the left of the White House.
The Green House’s owner drinks coffee.
The person who smokes Pall Mall rears birds.
The owner of the yellow house smokes Dunhill.
The man in the center house drinks milk.
The Norwegian lives in the first house.
The man who smokes Blends lives next to the one who keeps cats
The man who keeps horses lives next to the man who smokes Dunhill.
The man who smokes Blue Master drinks beer.
The German smokes Prince.
The Norwegian lives next to the Blue House.
The man who smokes Blends has a neighbor who drinks water.
The QUESTION:
Who owns the fish?
Not able to display all image from DB except 1st image.
Category: Latest Asked Questions | 0 views | Add a Comment
CODE VIEW OF DISPLAY PAGE:
public string FormatURL(object strArgument)
{
return ("Read.aspx?Coins=" + strArgument);
}
SOURCE VIEW OF DISPLAY PAGE:
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
Image:<asp:Image ID="Image1" runat="server" Height="50px" Width="100px" imageUrl=’<%#FormatURL(DataBinder.Eval(Container.DataItem, "coins")) %>’/>
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CoinsString %>"
SelectCommand="SELECT [imgdata], [imgtype], [Coins] FROM [TABLE] WHERE ([Coins] = @Coins)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="Coins" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
CODE VIEW OF READ PAGE:
protected void Page_Load(object sender, EventArgs e)
{
string strImageID = Request.QueryString[0];
SqlConnection cn = new SqlConnection("Data Source=MAKJAIN;Initial Catalog=DATABASE;Integrated Security=True");
SqlCommand cmd = new SqlCommand("select imgtype,imgdata from TABLE where coins=’" + strImageID + "’ ", cn);
//
try
{
cn.Open();
SqlDataReader dr;
dr = cmd.ExecuteReader();
while (dr.Read())
//yup we found our image
{
//retrving the image content type
Response.ContentType = dr["imgtype"].ToString();
//displaying the image
Response.BinaryWrite((byte[])dr["imgdata"]);
}
cn.Close();
}
catch
{
}
having trouble returning single record
Category: Latest Asked Questions | 0 views | Add a Comment
All of the other methods I’ve done were returning an array of data. This is the only one I’ve had to do so far that is returning a single record.
Can anyone help figure out what I’m doing wrong or what I might be missing?
And Happy New Year!
public static Credentials verifyCredentials(String VSnumber,
String emailaddress, String password) {
WEBCREDEN cr = new WEBCREDEN();
cr.getREQUEST_LIST().setREQ_VSNO(VSnumber);
cr.getREQUEST_LIST().setREQ_EML(emailaddress);
cr.getREQUEST_LIST().setREQ_PWD(password);
cr.invoke();
Credentials o = new Credentials();
o.setVSnumber(cr.getRESPONSE_LIST().getRSP_VSNO());
o.setEmail(cr.getRESPONSE_LIST().getRSP_EML());
o.setSessionID(cr.getRESPONSE_LIST().getRSP_SESSION());
o.setStatus(cr.getRESPONSE_LIST().getRSP_STATUS());
o.setLastname(cr.getRESPONSE_LIST().getRSP_LSTNM());
o.setFirstname(cr.getRESPONSE_LIST().getRSP_FRTNM());
o.setTitle(cr.getRESPONSE_LIST().getRSP_TITLE()); o.setCountry(cr.getRESPONSE_LIST().getRSP_CNTRY());
o.setPostalcode(cr.getRESPONSE_LIST().getRSP_POSTAL()); o.setPhonenumber(cr.getRESPONSE_LIST().getRSP_PHONE());
o.setType(cr.getRESPONSE_LIST().getRSP_TYPE());
System.out.println("Returned: " + o.getEmail());
return null;
}
