|
I have used a web service to return a dataset and the code is as follows.
<webmethod()> Public Function getSourceData() As DataSet
Dim L_DS As DataSet
Dim L_SQL As String
L_SQL = "SELECT NAME, ADDRESS FROM TESTER"
Con_OBJ.GetDataSet(L_SQL, L_DS)
Return L_DS
-----
In my application i have used the below code
L_DSNew = New DataSet
Dim myWebService As New localhost.sourceData
L_DSNew = myWebService.getSourceData()
L_DSCurrent.Merge(L_DSNew) 'Dataset with already existing values from the table
L_DSCurrent.AcceptChanges()
L_DA.Update(L_DSCurrent) 'Dataadapter initialised with all update, insert, delete commands and relevant parameters.
But, when I queried for any changes in the dataset, it returns false and No database update happens
M Kumar
Web Application Developer
|
|
|
|
|
Is it possible to create an ASP page with an Ink feature
for example a signature field??
Thanks.
I know its possible in C# WinForms
|
|
|
|
|
Hi,
i have asked to create a user control for master page which basically parses an xml file and decides things like if the datagrid has paging or not and if the datagrid can be edited or not.
I dont have much idea as to how to start of with.Can anyone throw light on this or suggest few related links.
thnks in advance.
|
|
|
|
|
Hi all. I'm having a little trouble adjusting the functionality of the calendar control. I'm trying to convert the text of the title to a hyperlink. By the title, I mean the name of the Month that is displayed kind of like a header, at the top and positioned in the middle (ie. January 2006, February 2006, etc...). Is there anyway for me to change the behaviour so that it's linkable to another page? Thanks in advance!
|
|
|
|
|
I have a couple of questions, I am developing a small application Kiosk Style the UI will be controlled by Touch Sceen only. My question is
1. how do i make the browser full screen? No title bar, no status, I would like the only function to be those presented by the application (asp.net, C#).
2. Can I use flash to be the front end and use ASP.NET (c#) as my language? Is there a way I can send a string from flash to ASP.NET?
3. I am going to run this with stored procedures with SQL server 2000. Should my insert functions be stored procedures. there is a possibility that up to 10 stations (kiosk) could theoretically run at the exact same time.
|
|
|
|
|
Hi,
I have a datagrid, in which i want to highlight today's date row when that page is loaded.
any body have any idea?
thanks,
NIKI
|
|
|
|
|
HI,
At the time of databoud(in event ItemDataBound),
Check the date field with current date, if matches, change the backcolor of the row.
Its really easy
Thanks,
Sushant Duggal.
|
|
|
|
|
I tried that. but i think my syntax is not good. If you can guide me.And also if the current date is not in the list, it should highlight most nearest future date in the datagrid.
Thanks,
NIKI
|
|
|
|
|
HI niki,
Send me the code here, i'll try to find the error.
If you have not written the code, then i'll give u the code.
Thanks
Sushant Duggal.
|
|
|
|
|
Hi Sushant,
The code for comparing the today's date is not here, but other thing which i implemented is here.
public void dg_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseover","this.style.cursor='hand'; this.style.backgroundColor='pink'; ");
e.Item.Attributes.Add("onclick","javascript:ShowDetail('"+DataBinder.Eval(e.Item.DataItem,"EVENT_DT")+"');");
ShowDetail is my js function, but it nothing to do with this issue.
the full issue is like : I need to highlight today's date if it's available in the datagrid, or nearest future date from today.
If you can send some code, that's really helpful for me.
I really appreciate your help.
Thank you very much Sushant.
NIKI
|
|
|
|
|
HI NIKI,
This is what i think u need...
Please try this code :
<br />
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)<br />
{<br />
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)<br />
{<br />
DateTime dt = Convert.ToDateTime(e.Item.Cells[5].Text);
if(DateTime.Compare(DateTime.Today, dt) == 0)
e.Item.BackColor = Color.Aqua;<br />
else if(DateTime.Compare(DateTime.Today, dt) == -1)
e.Item.BackColor = Color.Yellow; <br />
}<br />
}<br />
I hope this helps you
THanks
Sushant Duggal.
|
|
|
|
|
Hi Sushant,
Thank you very much for help.
along with your code, i am adding this two lines. if i dont have today's date or future dates in my datagrid it will highlight the latest past date in datagrid.
else if(DateTime.Compare(DateTime.Today, dt) == +1)
e.Item.BackColor = Color.red;
But, this makes backcolor red for all past dates rows instead of just a single latest past date.(I have at present, no future dates or today's date)
I want to highlight only latest past date in datagrid.
Any help??? that's really urgent.
and, adition to that, it should pass the value for that row as default to the client side javascript function when page load (this should be same for future date, today's date or latest past date).i am trying with 'onload' function, but it's not working.
Presently i m passing values on 'onclick' event, as below:
e.Item.Attributes.Add("onclick","ShowDetail('"+
DataBinder.Eval(e.Item.DataItem,"TOPIC_DATE")+"');");
any thing you can suggest, it will be very much helpful for me.
Thanks you very much again.
NIKI
|
|
|
|
|
HI Niki,
if you want to do that, then you need to add all the rows information of the datagrid in an data table.
do one thing,
create a datatable(define the datatable globally) , take two columns , one for date and one for row index.
do this in ItemDatabound event.
then where you are binding the grid, after datagrid.DataBind(), compare and change the color.
I hope you got my idea , and this idea works
Thanks
Sushant Duggal.
|
|
|
|
|
Hi Sushant,
This should not work??
if(DateTime.Compare(DateTime.Today, dt) == +1)
{
e.Item.Attributes.Add("onload","this.style.backgroundColor='red';");
I don't know, i m not sure.
Thanks,
|
|
|
|
|
hi niki,
where r u checking that it is the latest one??????
This will color all the rows.
Sushant Duggal.
|
|
|
|
|
Hi Sushant,
I have all the past values at present.
so, i want to highlight only the latest past date row.
but instead, it's highlighting all past values.
I am checking in the item_databound property.
Thanks,
NIKI
|
|
|
|
|
HI Niki,
what I wrote in the last thread was to change backcolor of one row only.
I got a new and easy Idea.
DO one thing, on the page load event, get the max date from the database, then in ItemDataBound compare that date with all the rows, which ever matches, change the backcolor of that row.
I think this is really easy
Thanks
Sushant Duggal.
|
|
|
|
|
No. I don't use datagrids.
---
b { font-weight: normal; }
|
|
|
|
|
Yes, still trying to add a blank line to my datagrid. The user clicks a button and executes the following code:
DataTable dt = ds.Tables["Rest"];<br />
DataRow row;<br />
row = dt.NewRow();<br />
row.ItemArray = dt.Rows[0].ItemArray;<br />
row["PartNumber"] = strPartNumberInputReference;
But I always get "no row in position 0" error. I have been researching for about 2 hours and not finding anything useful in my case. Does anyone have an idea?
|
|
|
|
|
dt.NewRow() only creates a new row for you with the columns available.
After assigning your row value, you need to add it back to the DataTable.
If I'm not wrong, this should do it: dt.Rows.Add(row);
Hope that helps.
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
Hi
I have some drop down lists and text boxes in my datagrid rows and whenever the selection is changed in the drop down box, I update the text of the text box for that row thru a javascript. However, I am not seeing the updated values (thru the javascript code) in the datagrid on postback to the server.
Is there a way to get around this problem?
Thanks
|
|
|
|
|
hi tsramkumar,
as u are modifying the value of textboxes in client side it will not be seen by the server.Rather use some hidden textboxes to hold the value of datagrid textboxes.
Tirthadip
|
|
|
|
|
I'm using the SiteMapPath control which works fine on most of my pages. However, it doesn't work at all on some. For example, there are newsitems on the front page which are viewed/edited/created from ~/News/Default.aspx. For different operations it appends parameters for the url. For example, to edit an news item the path looks like this: ~/News/Default.aspx?op=Edit&id=XX (or more succinctly, ~/News/?op=Edit&id=XX) where XX is the unique id in the database for the news item in question. In my Web.sitemap file I have:
<br />
<siteMapNode url="News/Default.aspx" title="News"><br />
<siteMapNode url="News/Default.aspx?op=AddNew" title="Add New"/><br />
<siteMapNode url="News/Default.aspx?op=Edit" title="Edit"/><br />
<siteMapNode url="News/Default.aspx?op=Delete" title="Delete"/><br />
<siteMapNode url="News/Default.aspx?op=Read" title="Read News Item"/><br />
</siteMapNode><br />
Now, because there is more appending past the op=Edit the SiteMapPath doesn't display that you are on the Edit page, but rather just the plain old Default.aspx page. I have tried putting an astericks on the end thinking maybe it would work like a wildcard, but it did not. Is there anyway to overcome this problem or should I be looking into passing the id's with session variables?
|
|
|
|
|
There are two options which you can try:
+ Use the SiteMapResolve event to modify the URL, you can see more via the example[^]:
+ Use the urlMappings[^] to rewrite the URL, in the Web.sitemap you can define the SiteMapNode like this:
<siteMapNode url="News/AddNewNews.aspx" title="Add New"/>
and in the web.config file, you can add an entry in the urlMappings:
<urlMappings>
<add url="~/News/AddNewNews.aspx"
mappedUrl="~/News/Default.aspx?op=AddNews" />
</urlMappings>
|
|
|
|
|
The SiteMapResolve options intrigues me so I attempted to do it using the MSDN site as a guide but I cannot get it to work at all.
I have assigned the event handler in both Page_Load and On_Init and nothing happend:
EDIT: not at the same time
<br />
SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(this.FixSiteMapPath);<br />
And this is the super simplified handler just so I could see it work, which it doesn't.
<br />
protected SiteMapNode FixSiteMapPath(Object sender, SiteMapResolveEventArgs e)<br />
{<br />
SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);<br />
SiteMapNode tempNode = currentNode;<br />
<br />
tempNode.Url = "News/Default.aspx?op=Delete";<br />
return currentNode;<br />
}<br />
What I don't understand is why the tempNode is created and why it returns currentNode? I've tried that way and just straight modifing currentNode, neither worked at all. I tried to debug the code, putting a break point in the handler, but I never hit it? So I put some code in the event handler unrelated (hid a control on the page) and when the page rendered the control was, in fact, not visible so I know I'm actually getting inside the handler, but no dice.
-- modified at 12:00 Tuesday 27th June, 2006
|
|
|
|
|