|
You're adding to your parameters in the following lines:
cmd.CommandText = "photosets";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
cmd.Parameters.Add("@Systemurl", SqlDbType.Image).Value = pic;
SqlParameter Src = new SqlParameter("@FilePath", SqlDbType.VarChar, 450);
cmd.Parameters.Add("@Amount", SqlDbType.NVarChar).Value = TextBox8.Text;
cmd.Parameters.Add("@Total", SqlDbType.NVarChar).Value = TextBox9.Text; The parameters collection has previously been assigned to by the command before it (even though you are changing the command you are issuing, you are still using the same command instance). Just before this, add the line
cmd.Parameters.Clear();
|
|
|
|
|
|
Hai Experts
I have done googlemap with single marker dynamically . i have tried same way for multiple marker where latitudes and longitudes comes from database .can u please suggest me How to approach.
Regards
venu
|
|
|
|
|
Venu,
I have used the control from subgurim to achieve what you are looking for. It works good. Have a look at it. Here is the
link
Thanks
|
|
|
|
|
Will you please post some code on how to make a persistence by making a page like igoogle.Sorry for bad english.
|
|
|
|
|
Sure.
private void MakePersistenceLayer()
{
IUnityContainer accessor = Context.ApplicationInstance as IUnityContainer;
if (accessor == null)
throw new ArgumentNullException("IUnityContainer should not be null");
IPersist persist = accessor.Resolve<Persister>();
persist.MakePersistent();
} There, I've given you a head start here. I leave it to you to fill in the trivial bits.
|
|
|
|
|
Hello all,
I am having a problem while refreshing my parent window.
I have a webform and I am using a viewstate on this form. on the viewstate's 3rd activeform I have a table. In a row of this table when the radiobutton's value is equal to No(I am doing an autopostback here) a popup window opens. Here on the popup window I make user to select some items in the checkbox list and carry the data to a textbox in the parent form. Till here everything is fine.
My problem is I can not close the popup. What happens is;
I can successfully pass the data to my parent window, refresh it but the popup windows closes and it popups again.
I am trying to do it with this code;
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.document.forms(0).submit();self.close();</script>");
What I also tried;
ClientScript.RegisterStartupScript(typeof(Page), "closePage", "window.onunload = CloseWindow();");
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.location.reload();self.close();</script>");
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.location.href = window.opener.location.href;self.close();</script>");
Page.RegisterStartupScript("CLOSE", "<script language='javascript'>window.opener.history.go(0) = window.opener.location.href;self.close()</script>");
These three doesnt work the way I want. They either popup the popup again, or close the popup, reload the parent but then parent goes back to Viewstate's active viewindex 1 instead of staying in 3.
Any ideas how can I fix this? Thanks
|
|
|
|
|
Hi,
I have a table in database for messages and it has these fields:
MessageId / SenderId / Message / Date
I'd like to create a list of messages but only show the latest message from each user not listing whole messages just like how facebook shows messages.
Is there a way to get the exact result by a sql query or I have to first get all the data from the database then build the list I want?
Thank you
|
|
|
|
|
You can do this (at least partially) in the db. For example:
SELECT ...
SUBSTRING(m.Message,1, 80) AS PartialMessage,
...
FROM Messages m
WHERE m.MessageID IN (SELECT MAX(m2.MessageId)
FROM Messages m2
GROUP BY m2.SenderId)
The above (with typos corrected etc ) should fetch the latest messsages for each sender and bring only first 80 characters of the message.
In the example I'm relying on a fact that the MessageId field is constantly growing number so it will order the messages correctly. If this is not true then you would have to use the date field to get the latest messages.
|
|
|
|
|
Farhad Eft wrote: Is there a way to get the exact result by a sql query
Yes if you want sorted data then use 'order by' statement.
if you want some condition data then use 'where' condition.
No need to get all the data from database and then build list.
|
|
|
|
|
Hi
In a Sql Server database we have a Patient table and a ReferHospital table. The ReferHospital table is a lookup table. There is a Foreign key column (RefHospID) in the Patient table.
In the past the Referring hospital was not a required input field, but it has become a required field for input recently.
I have a DetailsView on the page and I have made one of the fields a TemplateField. In the EditItemTemplate and InsertItemTemplate I have a DropdownList that is databound to the ReferringHospital table in the database.
So the two things I would like to achieve is:
1.) When an old patient record is loaded and the RefHospID field is null, the DropDownList must accept the null and display the initial value “- select -”.
2.) When a new patient is inserted (or an old patient edited) there must be a validation to check that the initial value “- select -” is not still selected, but that a RefHosp has been selected in the DropDownList.
I manage to get these two things working individually but not combined.
I set the AppendDataBoundItems property to true and added the initial value as a ListItem.
Markup of the DropdownList
<asp:DropDownList ID="DropDownList_HP" runat="server"
AppendDataBoundItems="True" DataSourceID="SqlDataSource_RefHosp"
DataTextField="HospName" DataValueField="HospID" SelectedValue='<%# Bind("HospID") %>' Enabled="True">
<asp:ListItem Selected="True" Value="">- select -</asp:ListItem>
</asp:DropDownList>
The code in bold is to enable the DropDownList to accept null values from the database. (This info I found at http://msdn.microsoft.com/en-us/library/ms366709.aspx )
I also added a RequiredFieldValidator to ensure that a value other than “- select -” is selected.
<asp:RequiredFieldValidator ID="RequiredFieldValidatorDV4" runat="server"
ControlToValidate="DropDownList_HP"
ErrorMessage="Select a referring hospital"
InitialValue="- select -" ValidationGroup="PatientInputGroupDV4"
SetFocusOnError="True"></asp:RequiredFieldValidator>
The problem is that without
Selected="True" Value=""
In the ListItem of the DropDownList an exception is thrown which says the DropDownList has “SelectedValue which is invalid because it does not exist in the list of items.”
And with
Selected="True" Value=""
The RequiredFieldValidator does not complain when ‘- select -’ is still selected when I want to update from the DetailsView.
Does anyone have any solutions for this problem.
Regards.
Kobus
|
|
|
|
|
You could use a RangeValidator rather than a RequireFieldValidator. Assuming the selected value for the default item (-select-) is -1, set the MinimumValue attribute to 0 and the MaximumValue attribute to some number beyond the expected number of items, say 9999
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
As per my understanding and according to your dropdownlist value, initial value should be blank of Required field validator.
<asp:RequiredFieldValidator ID="RequiredFieldValidatorDV4" runat="server"
ControlToValidate="DropDownList_HP"
ErrorMessage="Select a referring hospital"
InitialValue="" ValidationGroup="PatientInputGroupDV4"
SetFocusOnError="True"></asp:RequiredFieldValidator>
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
In required field validator set InitialValue="0" ;
Thank you.
|
|
|
|
|
Thank you prasanta_prince
In my RequiredFieldValidator I have set the InitialValue="" and it works great.
Regards.
Kobus
|
|
|
|
|
@kbalias, Good to know your problem is solved.
|
|
|
|
|
Hii All,
I am using below method to pass data to paypal.
"/
/ThankYou.aspx" />
" />
" />
Please help in calculating tax?
for singapore customer i need to charge 7%
Please help
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Hi,
Is there any body who has done this before..??? how can i implement new skin in AuctionWorx.???
|
|
|
|
|
The best place for you to ask this is on the vendors support site[^]. It's highly unlikely that somebody cruising by the forum will just have happened to do this.
|
|
|
|
|
I have a weird problem:-
I have a two databases(A and B). Database A is used by the company's site and everything works fine. I created database B that uses the same user as Database A. I have created a base login site ( site B) using SQL membership provider in asp.net2.0 and this site connects to Database B, everything works fine locally but when I publish this site and upload it I cannot get the user log in.
1) I tired testing with the forgot password and I get the error "We were unable to access your information. Please try again. ". So I thought it was the web confog problem, to rule it out I changed the connection in siteB's web config to point to database A and it works fine. If I change the conection to dabase B it doesnt work.
2) I have added the application name setting too in the webconfig
Here is the web config:-
<connectionStrings>
<add name="dbconnection" connectionString="Data Source=SQLOLEDB.1;Data Source=.;Initial Catalog=DatabaseB;User ID=test;Password=test123"/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=SQLOLEDB.1;Data Source=.;Initial Catalog=DatabaseB;User ID=test;Password=test123"/>
</connectionStrings>
<system.web>
<roleManager enabled="true">
<providers>
<add name="SqlRoleManager"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="LocalSqlServer"
applicationName="/SiteB" />
</providers>
</roleManager>
<connectionStrings>
What am I doing wrong? Is there some permission that is not set in the new database. Its a basic SQL Server 2005 database and I used the aspnet sql tool to create the tables for the sql server membership.
Please help. I am stuck on this for over 72 hours.
|
|
|
|
|
One possibility is that the account is locked if you have tried to log in with wrong password for several times. Using Management Studio, open the login properties and see if it's locked (and of course if it is, unlock it ).
|
|
|
|
|
hi,
So with Database A you can connect and with DB B you cant. i hope its the problem with the permission of user to connect with DB B. Check the user permission for that DB. Go to managemt studio, take the Server logins, pick the user id, then check the permissions of that user to Database B. make sure, the user checked as db_owner. Good luck.
|
|
|
|
|
Hi All ,
I am using Paypal sandbox testing.
It is working fine, I still want to get the transaction status whether successful or failure only the payment is completed.
so I know paypal will return some hidden variables like "tx" to the successfull page.
My issue is I need to get the PDT token from sandbox.paypay.com,
But it is asking for the live url like www.test.com/sucess.aspx however i want to test in local url like http:\localhost:3030\sucess.aspx but not accepting.
so my question is how can i test in local url and generate token for local url..
Apologize if my communication is wrong.....
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
hello
Why this code does not run correctly on Linux server
<br />
TcpClient client = new TcpClient("www.zooo.ir", 80);<br />
NetworkStream stream = client.GetStream();<br />
byte[] send = Encoding.ASCII.GetBytes("GET /index.php HTTP/1.1 \r\n\r\n");<br />
stream.Write(send, 0, send.Length);<br />
byte[] bytes = new byte[client.ReceiveBufferSize];<br />
int count = stream.Read(bytes, 0, (int)client.ReceiveBufferSize);<br />
String data = Encoding.ASCII.GetString(bytes);<br />
char[] unused = { (char)data[count] };<br />
textBox1.Text = (data.TrimEnd(unused));<br />
stream.Close();<br />
client.Close();<br />
But IIS is working properly
<br />
TcpClient client = new TcpClient("www.codeproject.com", 80);<br />
NetworkStream stream = client.GetStream();<br />
byte[] send = Encoding.ASCII.GetBytes("GET /default.aspx HTTP/1.1 \r\n\r\n");<br />
stream.Write(send, 0, send.Length);<br />
byte[] bytes = new byte[client.ReceiveBufferSize];<br />
int count = stream.Read(bytes, 0, (int)client.ReceiveBufferSize);<br />
String data = Encoding.ASCII.GetString(bytes);<br />
char[] unused = { (char)data[count] };<br />
textBox1.Text = (data.TrimEnd(unused));<br />
stream.Close();<br />
client.Close();<br />
<code><br />
Please Help:confused:<br />
:((
|
|
|
|
|
At a guess, I would say due to the lack of HTTP headers. I think IIS is forgiving when you don't send all the headers.
|
|
|
|