|
Find your answer here[^].
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
in that one article is deleted ....can u give me information abt api...
i want to display india,UK,USA country's stock information..
|
|
|
|
|
Hi Experts,
I am trying to display webcam video/Preview Image in Web browser. But I am not successes I tried following Methods.
1. Search webcam component
2. Used API calls and some related DLL file also.
Thanks in Advance.
|
|
|
|
|
|
Hi,
I have a datatable with tableadapter, and two parameterized queries.
The queries are quite straightforward, the parameter is the product EAN code, or the product number, and it returns a single row with product information (description, available stock, etc).
They both work perfectly, except when I run them for a certain product.
So I copy the query to sql server management studio, and they run fine, also for the offending products.
Through some googling I found that it is a common problem occuring to many, having (alternating) to do with EnforceConstraints, or field lengths, or data type mismatch, or AllowDBNull, with one common denominator: the query does not run at all...
But my query does run, just not for a couple of products. So I compare the queried data of a "good" product with that of a "bad" one, and lo an behold, the data is the same. No missing data, no differences in length, or data type, or anything.
Anyone who can shed some light on this, will be my hero.
Cheers,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
When the data has been verified manually, repeatedly, this error is usually the result of a constraint being accidentally assigned to the wrong column. Ie, instead of Customer.id = order.CustomerId you may have Customer.Id = order.ProductId. The constraints work in most cases for populated databases, however, fail at seemingly odd interval with no other explanation.
|
|
|
|
|
Thanks Ray, at the very least I am glad to hear I am not just crazy.
Ennis Ray Lynch, Jr. wrote: fail at seemingly odd intervals
In my case the query consistently fails when I run it with one product number and succeeds when I run it with another. When I run the page (query) in quick succession (good one, bad one, good one, bad one, etc) it consistently succeeds and fails (perhaps the title of this post wasn't chosen too well...) Is this behavior what you meant, or would it occur completely at random?
If you have had to deal with this problem as well, can you please suggest a work around or something ?
Cheers,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
You would have to post the schema's and the queries for the tables involved for someone to rule out database code. You mention that you are using a Table Adapter, are you using generated code or strongly typed DataTables? If so your code may not reflect your current database. For a quick test, in your ASPX code that is failing, randomly, replace your data access with straight data readers and no DataSet related objects and see if the error goes away. You have to slowly prove each piece of the code before you can identify which piece is wrong.
As for random, I seriously doubt the error is random, they never are. It is just the underlying cause has not yet been identified.
|
|
|
|
|
Unfortunately the table adapter is generated, so its a bit tricky to control, but I am going to take your advice and test my code until I find the offending bit.
I am also leaning towards your suggestion that the schema does not reflect the database, so I will first recreate the whole table adapter from scratch, to have it match up again. Who knows, that may already do the trick.
Thanks Ray, I appreciate your help.
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi,
currently i m using asp.net 2.0 with c#.
here i always redirect to an page while error occurs(in catch block). but i need to know what exactly the user enter the data(to check the error).
so if error occurs, then i like to take a screen shot of the page and store inside some folder(say, errorFolder).
how to accomplish. plz help me - KARAN
|
|
|
|
|
First of, I don't know if this is possible, but think about this, user enters some thing into the form then hits enter, off goes the page to be processed, then ooops, you trip, how in the world are you going to take the screen shot of the user display from the server? You need something on the client, don't you?
Since you indicated you are catching ( and possibly logging ) the exception that may give you a clue. If you need more info, you can log user inputs as well. Since you know your form get the user inputs and don't forget input validation.
|
|
|
|
|
You do not need to take print screen for the same.
You can store exception in session and then use
afterward to determine the cause of error.
Like,
catch(Exception e)
{
Session["Error"]=e;
Response.Redirect("Error.aspx");
}
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
thanks jinal,
currently i m doing the same.
to put it more clear i got an error message "Input string was not in a correct format". this error i can fetch. but i dont know what happened. right?
|
|
|
|
|
Find this[^] link useful.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
I have populated a dynamic grid view from database with Cell text as ON and OFF. I want that off text should appear in "Red" Colour.
Grid rows are generated as no.of employees and columns are days in a particular month from database.
|
|
|
|
|
Using RowDataBound is frequently the best way. Here's a quick example that changes the row color based on the status of a CheckBoxField.
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
If (e.Row.RowType = DataControlRowType.DataRow) Then
Dim cb As CheckBox = CType(e.Row.Cells(1).Controls(0), CheckBox)
If (cb.Checked = False) Then
e.Row.BackColor = Drawing.Color.LightYellow
e.Row.Cells(0).ForeColor = Drawing.Color.Red
Else
e.Row.ForeColor = Drawing.Color.Blue
cb.Enabled = True
End If
End If
End Sub
Please do not repost the question. You have already asked your question here[^]
You can write comment if you have any doubt or further query.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Its not working I have tried, moreover I need C# code. Please Help
|
|
|
|
|
Can you give me your code what you have written?
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
protected void gvEmpCal_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox ckh = e.Row.Cells[0].Controls.Add(0);
if (ckh.Checked = false)
{
e.Row.BackColor = System.Drawing.Color.LightYellow;
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
}
}
}
Actually I need that gridview cells that contains "off" should appear in red colour. Presently On and Off are in same colour.
|
|
|
|
|
Ok, I got the problem. I think you have not understand the code I have posted.
Do one thing.
Replace your
CheckBox ckh = e.Row.Cells[0].Controls.Add(0);
with this one
CheckBox ckh = e.Row.Cells[0].Controls[0];
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Good Day
i am using a RaSchedular(Telerik) and i have an XML File on my solution and i bind my Schedular like this
private void Bind_Viewer_For(String Module)
{
string strExpr = "Code like '%" + Module + "%'";
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml(@"C:\Pilot Project\App_Data\TimeTable.xml");
RadScheduler1.DataStartField = "STARTDATE";
RadScheduler1.DataSubjectField = "DESCRIPTION";
RadScheduler1.DataEndField = "ENDDATE";
RadScheduler1.DataKeyField = "ID";
dsfinal = xmlDatadoc.DataSet;
if (dsfinal.Tables[0].Rows.Count > 0)
{
DataView dv = dsfinal.Tables[0].DefaultView;
dv.RowFilter = strExpr;
RadScheduler1.DataSource = dv;
RadScheduler1.DataBind();
RadScheduler1.SelectedView = SchedulerViewType.MonthView;
RadScheduler1.SelectedDate = Convert.ToDateTime(dv.Table.Rows[30]["ENDDATE"]);
}
}
dsfinal is declared Globally. i am filtering my data as you can see in the expression and bind the control with the Detail view. Now , my problem is when the updates are made. In the Schedular when updates are made , or when an appointment is moved
i need to Update the Dataset with the changes made. The Demo here Explains a simple xml binding, but i am binding the Schedular with a Dataset and when changes i made, i want to save the changes in the dataset.
Now i have a save button that is supposed to take the changes made in the dataset and merge it back to the xml and my code looks like this
protected void btnCommitChanges_Click(object sender, EventArgs e)
{
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml(@"C:\Pilot Project\App_Data\TimeTable.xml");
DataSet dslist = new DataSet();
dslist = xmlDatadoc.DataSet;
dsfinal.Merge(dslist);
dsfinal.WriteXml(@"C:\Pilot Project\App_Data\TimeTable.xml");
}
as you can see , i am taking the xml that is currently on the file system and i am loading it to a dataset and merge the two dataset. My question here is that is it going to updates the changes or it will override or insert new elements as if i am adding a new record on the xml ?
Again, after refresh the page, i could see the changes were not saved and the xml have not changed from the changes that were made in the dataset.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
hi i have a two aspx pages page1.aspx and page2.aspx on each page there is a link which open a new window using above javascript, but i want to know the previous page information eighter it open using page1.aspx page or page2.aspx page.
request object is null, so i'm unable to identify.
KnightGuy
|
|
|
|
|
You can access controls of parent page using
window.opener.document.getElementById.
So by using it you can access parent page and do
communication between child and parent page.
For more information refer this[^] link.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
If you want to know in server side then pass a query string value ( ex: page1.aspx?ref=page2) and get the querystring value in server side using Request.QueryString["ref"] . Hope this will solve ur problem.
|
|
|
|
|
Dear, the request object is null.
KnightGuy
|
|
|
|