|
sparlay_pk wrote: the error is looks like this..
Login failed for user 'sa'.
Does the Database having the access of that Sa. Please check the database security settings from SQL Sever Management Studio. Are you able to login in SSMS using the same user name and password that you are using in your application ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Yes it works for username sa and password abc...
The time I am including new queries with adapter it shows data correctly.
Also if i click on any adapter to preview data it works...
|
|
|
|
|
Where have you defined that? How are you trying to change it?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Thanks Bro. I solved the problem...
|
|
|
|
|
|
It would be great if you can share with others, it might help someone.
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
|
Hi All,
I'm tring to create a very simple composite control, consisting of a textbox and a label (and some html to style it..)
I have created it and at first it seemed to work, but now it appears I have missed out something fundamental.
I have a Text property in which I am setting the text property of the child text control and retreiving the same child property.
public string Text
{
get
{
EnsureChildControls();
return childTextBox.Text;
}
set
{
EnsureChildControls();
childTextBox.Text = value;
}
}
This works fine, unless on loading the page containing the control, I assign some text to the Text property. The text I assign appears in the child textbox fine, but when edited and attemped to save, it loses the new child textbox value, and reverts to the Text property as it was set on page load (or any other event that I use to populate it).
I'm guessing it's some kind of viewstate issue? Though this is the first time I have attempted a custom control of any sort and the help I've been looking up has led to me breaking it completely a number of time while trying various solutions.
If anyone has any idea what the problem is, then I'd appreciate your help as I'm running out of time to spend on it and don't want to have to abandon it because of deadlines.
Thanks in advance..
Mark
|
|
|
|
|
Where are you setting the default value for the textbox? In the Load event of your user control? Have you place that inside if(!IsPostBack) block?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi,
Thanks for the reply. Yes it was in the page load and even though I tried it on other events, I somehow never remembered to remove the onload version of the event, coupled with it not being in a (!Page.IsPostBack) block.
Having done that, it works just fine.
Thanks for pointing out the error, I'd spent so long looking for problems with the control, I didn't even think it could be with my page
Thanks again
Mark
|
|
|
|
|
Hello friends,
How do I embedding a search engine in ASP.NET applications?
Thanks always.
Tunsten
|
|
|
|
|
You want to search with in your site ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
i am using an update panel with a gridview and want to loaad and perform all update . delete , select operations throug
update pabel without complete page refresh but i cant fo that
here is what i am doing ,
<asp:scriptmanager id="ScriptManager1" runat="server">
<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:gridview id="GridView1" runat="server"
="" autogeneratecolumns="False" datakeynames="customerid" onrowdeleted="GridView1_RowDeleted" onrowupdated="GridView1_RowUpdated" showfooter="True" onrowcommand="GridView1_RowCommand" backcolor="White" bordercolor="White" borderstyle="Ridge" borderwidth="2px" cellpadding="3" cellspacing="1" allowpaging="True" onrowcancelingedit="GridView1_RowCancelingEdit" onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" onselectedindexchanged="GridView1_SelectedIndexChanged" width="1070px" horizontalalign="Left" pagesize="5" onpageindexchanging="GridView1_PageIndexChanging">
<rowstyle backcolor="#DEDFDE" forecolor="Black" wrap="True">
<columns>
<asp:templatefield headertext="Customer ID">
<footertemplate>
<asp:button id="btnsave" text="Insert Record" commandname="Add" runat="server">
<asp:textbox id="add_customerid" runat="server">
<itemtemplate>
<asp:label id="lblcustomerid" runat="server" text="<%#Eval("customerid") %>">'
<asp:templatefield headertext="Company Name">
<itemtemplate>
<asp:label id="lblcompanyname" runat="server" text="<%#Eval("companyname") %>">'
<edititemtemplate>
<asp:textbox id="up_txtcompanyname" runat="server" backcolor="green">
<footertemplate>
<asp:textbox id="add_txtcompanyname" runat="server">
<asp:templatefield headertext="Contact Tiltle">
<itemtemplate>
<asp:label id="lblctitle" runat="server" text="<%#Eval("contacttitle") %>">'
<edititemtemplate>
<asp:textbox id="up_contacttitle" runat="server" backcolor="green">
<footertemplate>
<asp:textbox id="add_contacttitle" runat="server">
<asp:templatefield headertext="City ">
<itemtemplate>
<asp:label id="lblcity" runat="server" text="<%#Eval("city") %>">'
<edititemtemplate>
<asp:textbox id="up_city" runat="server" backcolor="green">
<footertemplate>
<asp:textbox id="add_city" runat="server">
<asp:commandfield buttontype="Image" cancelimageurl="~/Cancel.gif"
="" deleteimageurl="~/Delete.gif" editimageurl="~/Edit.gif" showdeletebutton="True" showeditbutton="True" updateimageurl="~/Update.gif" selectimageurl="~/Plus.gif" selecttext="Order Details" showselectbutton="True">
<footerstyle backcolor="#C6C3C6" forecolor="Black">
<pagerstyle backcolor="#C6C3C6" forecolor="Black" horizontalalign="Right">
<selectedrowstyle backcolor="#9471DE" font-bold="True" forecolor="White">
<headerstyle backcolor="#4A3C8C" font-bold="True" forecolor="#E7E7FF">
<editrowstyle wrap="False">
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
Does it produce any error ?
|
|
|
|
|
no it does not , but i page is refreshing upon each grid commad operation,
how to make sure update panel is working correctly , i am new to asp.net.
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
Please checkout the link that I have provided.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
First of all your code is not understand at all. You need to post code with proper formatting.
Tauseef A wrote: <asp:updatepanel id="UpdatePanel1" runat="server">
<asp:gridview id="GridView1" runat="server"
autogeneratecolumns="False" <="" blockquote="">
Where is the ContentTemplate For Update Panel ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
it seems update panel is not working , because page is refreshing upoen each command operation.
how do i make sure that update panel is working , i am new to asp.net.
asp:ScriptManager ID="ScriptManager1" runat="server">
<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:gridview id="GridView1" runat="server"
="" autogeneratecolumns="False" datakeynames="customerid" onrowdeleted="GridView1_RowDeleted" onrowupdated="GridView1_RowUpdated" showfooter="True" onrowcommand="GridView1_RowCommand" backcolor="White" bordercolor="White" borderstyle="Ridge" borderwidth="2px" cellpadding="3" cellspacing="1" allowpaging="True" onrowcancelingedit="GridView1_RowCancelingEdit" onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" onselectedindexchanged="GridView1_SelectedIndexChanged" width="1070px" horizontalalign="Left" pagesize="5" onpageindexchanging="GridView1_PageIndexChanging">
<rowstyle backcolor="#DEDFDE" forecolor="Black" wrap="True">
<columns>
<asp:templatefield headertext="Customer ID">
<footertemplate>
<asp:button id="btnsave" text="Insert Record" commandname="Add" runat="server">
<asp:textbox id="add_customerid" runat="server">
<itemtemplate>
<asp:label id="lblcustomerid" runat="server" text="<%#Eval("customerid") %>">'
<asp:templatefield headertext="Company Name">
<itemtemplate>
<asp:label id="lblcompanyname" runat="server" text="<%#Eval("companyname") %>">'
<edititemtemplate>
<asp:textbox id="up_txtcompanyname" runat="server" backcolor="green">
<footertemplate>
<asp:textbox id="add_txtcompanyname" runat="server">
<asp:templatefield headertext="Contact Tiltle">
<itemtemplate>
<asp:label id="lblctitle" runat="server" text="<%#Eval("contacttitle") %>">'
<edititemtemplate>
<asp:textbox id="up_contacttitle" runat="server" backcolor="green">
<footertemplate>
<asp:textbox id="add_contacttitle" runat="server">
<asp:templatefield headertext="City ">
<itemtemplate>
<asp:label id="lblcity" runat="server" text="<%#Eval("city") %>">'
<edititemtemplate>
<asp:textbox id="up_city" runat="server" backcolor="green">
<footertemplate>
<asp:textbox id="add_city" runat="server">
<asp:commandfield buttontype="Image" cancelimageurl="~/Cancel.gif"
="" deleteimageurl="~/Delete.gif" editimageurl="~/Edit.gif" showdeletebutton="True" showeditbutton="True" updateimageurl="~/Update.gif" selectimageurl="~/Plus.gif" selecttext="Order Details" showselectbutton="True">
<footerstyle backcolor="#C6C3C6" forecolor="Black">
<pagerstyle backcolor="#C6C3C6" forecolor="Black" horizontalalign="Right">
<selectedrowstyle backcolor="#9471DE" font-bold="True" forecolor="White">
<headerstyle backcolor="#4A3C8C" font-bold="True" forecolor="#E7E7FF">
<editrowstyle wrap="False">
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
|
i have checked this link , even worked with that link example but still it refreshes.
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
Which Visual Studio version are you using ? is VS 2005 or Vs 2008 ? If VS 2005, please select AJAX Enabled web Site instead of Normal web site. Hope that may resolve your problem.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hello all
I have 2 textboxes on my aspx site which I want to validate.
I want to make sure that the second textbox value is higher than the first one.
For example:
The user inputs 40 in the first textbox and 20 in the second.
This will give an error since 20 is less than 40.
But if the user types 40 and 60 it should work.
It should also be numbers only
Any ideas?
Cheers!
|
|
|
|
|
What is the issue ? You can easily do it using JavaScript .
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Solved
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="CompareValidator" ControlToValidate="TextBox2" ControlToCompare="TextBox1" Operator="GreaterThan">
</asp:CompareValidator>
|
|
|
|