|
How can you expect so much from a forum ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
hi friends
i want to print barcode images on Crystal Report
barcode images are stored in sql server database as varbinary datatype
i want fetch these images and show it on crystal report
how can i do this ?
thank you
|
|
|
|
|
Hello friends...I use 2 datalists say dtlist1 and dtlist2 and two pagers say pager1 and pager2 for each of them resp..and onpageload dtlist2 is displayed by default. When user clicks on a button dtlist1 is displayed...and after clicking on the pager for that datalist1 ..It shows second datalist i.e. dtlist2 ....becoz on page load dtlist2 is to displayed..To avoid such confict in pager..i decide to use datagrid which has its own pager..Then the problem occurs to show datagrid horizontally...Do anyone have any solution.....
|
|
|
|
|
To get Calender for Past 3 months from present date for Archives
|
|
|
|
|
I have two dropdown lists on a webform using vs 2005/asp.net 2.0. The first is populated via an sqldatasource. The second dropdown list is populated via a second sqldatasource with a where clause based on the selected value of the first dropdown. In visual studio the population of both dropdowns work fine but when I publish to IIS only the first dropdown is populated. At this point I am out of ideas. Any suggestions would be greatly appreciated. Here is the source code.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<title>Untitled Page
<asp:sqldatasource id="SqlMethod" runat="server" connectionstring="<%$ ConnectionStrings:IngresConnectionString %>"
="" providername="<%$ ConnectionStrings:IngresConnectionString.ProviderName %>" selectcommand="Select distinct method from tmaster_shipped ">
<asp:dropdownlist id="ddlMethod" datasourceid="SqlMethod" runat="server" autopostback="True" datatextfield="method" datavaluefield="method" style="z-index: 100;
left: 116px; position: absolute; top: 128px">
<asp:dropdownlist id="ddlLab" runat="server" autopostback="True" datasourceid="labDatasource"
="" datatextfield="lab" datavaluefield="lab" style="z-index: 102; left: 108px; position: absolute;
top: 228px">
<asp:sqldatasource id="labDatasource" runat="server" connectionstring="<%$ ConnectionStrings:LocalMySQL %>"
="" providername="<%$ ConnectionStrings:LocalMySQL.ProviderName %>" selectcommand="SELECT lab FROM tmaster_labs WHERE METHOD=?">
<selectparameters>
<asp:controlparameter controlid="ddlMethod" name="Method" propertyname="SelectedValue" type="String">
|
|
|
|
|
|
When I perform the instructions found here: http://msdn2.microsoft.com/en-us/library/ms178294(VS.80).aspx[^] It works perfectly, but when I switch to using an ObjectDataSource instead of a SQLDataSource it throws an exception: "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints." Is there anything I can do to the ObjectDataSource to make it work as described in the instructions in the link above?
|
|
|
|
|
The error you are getting seems to indicate that one of your properties is coming across as null. I would guess that what ever you are using to populate your collection of your objects isn't properly defaulting some of the values. It seems like it is the values of the primary or foreign keys.
Hope that helps.
Ben
|
|
|
|
|
I appreciate your quick response. My problem is that it works when I use a SQLDataSource but doesn't work when using an ObjectDataSource. My question is why does it not work with the objectDS when it does work with the SQLDS? The reason I want to use the ObjectDataSource is so that I can add more functionality to the Object. If I could just get it to work as a dropdown in the Gridview Edit, I would be good to go.
|
|
|
|
|
The difference is the dataset that the sqldatasource returns is very different then the collection of Ienumerable of your object. I have written an article on the gridview that uses the object datasource. So it is not quite the same as what you are trying to do with the downdownlist.
If you are just trying to set the source ofthe dropdown in your gridview that shouldn't be too hard. If you are trying to populate the dropdown I can see how that would be a little harder.
Ben
|
|
|
|
|
Thank-you for your responses. I started thinking through it and realized that I was headed in the wrong direction. I switched to using the SQLDataSource and it's working great. It was a case of trying to make it more complicated than it needed to be.
Thanks for you help.
|
|
|
|
|
Hi.
I'm new to ASP.NET (but not C# or VB.NET).
In a nutshell, I have a class (MyClass ) that exposes multiple public properties, and another collection class that Inherits from Hashtable to give a strongly typed collection of the first class, where 'Add' , 'Remove' and 'Item' are implemented to shadow those from the base (HashTable) class by accepting or returning a MyClass object.
I also have a GridView that has its DataSource set to an ObjectDataSource that returns an instance of the collection. Now, at design time, the grid can see all of the public properties of MyClass but, when run, fails with the error I gave in the Subject of this message.
Now, if I change the code so that instead of returning a HashTable I return an array MyClass() , all is well. The designer can still see all of the properties and the code runs fine.
Does anyone know why this is? If the designer can see the properties at deign time then why not at run time?
I would really rather have my code return the collection instead of the array.
Many thanks for your help.
Kelvin
|
|
|
|
|
In my experience I have used Generic lists for my objectdatasource to return not Hashtable. Something like List<myclass>. Anyway, I have found it to work quite well for me.
Hope that helps.
Ben
|
|
|
|
|
I have a situation where I need your help. I have home.aspx page, which is consuming three frames as Leftmenu, TopMenu and MainContent. As name suggests leftmenu is for lefthand side menus, Topmenu is for company logo etc and maincontent iframe is for all other pages display which are selected by user from LHS menu.
I am displaying User name through session value on TopMenu iframe. This session is coming from default.aspx page.
Now problem start from here…Application provides the flexibility to user to change the user name from inside the application through one menu option. So for this we had provided an interface which gets open in mainContent iframe. On click of Submit button, I reset the value of session but it is not reflecting on TopMenu page as this is on different iframe.
If i do F5 then value get change on topmenu.aspx.
I tried to refresh the same page through JavaScript also but I am having bad luck as of now….Please let me know the best and shortest way to do so...
Amit
|
|
|
|
|
call a js function on clientclick event of submit button, and refresh the top frame page like this
window.parent.frames("topframe").location="topframepage.aspx"
i hope this will work.
many thanks,
adnan
Many Thanks,
Adnan Rafiq
muhammadadnanrafiq@gmail.com
|
|
|
|
|
No it does not help....Any other suggestion
|
|
|
|
|
hi
i am dev a web application in visual web dev express..
wen using the gridview control i wanted that the date column be formated in (dd/MMM/yyyy) format.
i m entering in the gridview EDIT ITEM option
{0:dd/MMM/yyyy}
this aint working.
how can i do this..
Kunal Piyush
|
|
|
|
|
If you are using the Eval method of binding it looks like this:
<%# Eval("Date", "{0 }")%>,
If you are using a boundfield it looks like this:
<asp:boundfield datafield="Dtm" sortexpression="Dtm" headertext="Date" htmlencode="False" dataformatstring="{0 }">
Finally if you use a DataBinderEval (that is what I suggest)
You have this:
<%# DataBinder.Eval(Container.DataItem,"Date").ToString("dd/MMM/yyyy") %>
The other two options you really can't give it the dd/MMM/yyyy format.
Hope that helps.
Ben
|
|
|
|
|
kubben wrote: Finally if you use a DataBinderEval (that is what I suggest)
You have this:
<%# DataBinder.Eval(Container.DataItem,"Date").ToString("dd/MMM/yyyy") %>
hey
i tried wat you said
on the page load event i wrote this
DataBinder.Eval(GridView1.Columns[10], "Date").ToString("dd/MMM/yy");
i couldnt get wat COntainer.dataitem meant.. there wasnt any optio for the same.. i used columns[10], since the date column was the 10th including 0..
but i get an error..
tostring only takes 1 argument..
please help
Kunal Piyush
|
|
|
|
|
In the gridview. You need to convert the column you want the date in to be an ItemTemplate. In the ItemTemplate you need a Label control. In the Text property of the Label control you need to put the this:
<%# DataBinder.Eval(Container.DataItem,"Date").ToString("dd/MMM/yyyy") %>
The page load event is not the correct place to put this code.
So if you look at your gridview in the HTML mode you will find the <Columns> node
YOu need code like this:
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lbDate" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Date").ToString("dd/MMM/yyyy") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
NOTE the Date that comes right after the Container.DataItem is what ever your are calling your date field.
Hope that helps.
Ben
|
|
|
|
|
this is wat i did..
<asp:TemplateField HeaderText="Dt" SortExpression="Dt">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Dt") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Dt").ToString("dd/MMM/yyyy") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
still that error..
Error 1 No overload for method 'ToString' takes '1' arguments C:\Documents and Settings\Kunal\My Documents\Visual Studio 2005\WebSites\diag\User\viewalldoc.aspx 25
Kunal Piyush
|
|
|
|
|
Sorry I missed on thing:
'<%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem,"Dt")).ToString("dd/MMM/yyyy") %>'
That should work.
Thanks,
Ben
|
|
|
|
|
hey
now the program is compiling.. but again 1 problem.
when the grid is displayed the "Dt" column shows the whole HTML tag, instead of the date.
i am using VISUAL WEB DEVELOPER EXPRESS 2005.. is is a problem of obsolete tag.
Kunal Piyush
|
|
|
|
|
I am guessing there is an unbalanced quote or something. Include the code and I will see if I can see anything wrong with it.
Ben
|
|
|
|
|
i am including the code..
though there shud have been an error regardin an unbalanced tag..
but still
<asp:TemplateField HeaderText="Dt" SortExpression="Dt">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Dt") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%Convert.ToDateTime(DataBinder.Eval(Gridview1.DataItem,"Dt")).ToString("dd/MMM/yyyy"))%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Kunal Piyush
|
|
|
|