|
Please check the following line.
if (IdentityValue == 1)
ExistingAssociatetbl.Rows.Find(Sno = 1).Delete();
Some assignment is happening in the find method when it expects an object . Please check it.
"Never put off until run time what you can do at compile time."
- David Gries, in "Compiler Construction for Digital Computers", circa 1969.
|
|
|
|
|
Hi,
(1) If you have any access to "event viewer" of the hosting server, did you get any exception details there or any more information?
(2) I have seen you have provided a big code block, however did you identify which line it is causing the exception?
if you can do that it would be great so that we can help you more.
Thanks,
Arindam D Tewary
|
|
|
|
|
Hey hi..
this block actually
if (ExistingAssociatetbl.Rows.Count > 0)
{
IdentityValue = Convert.ToInt16(ExistingAssociatetbl.Rows[ExistingAssociatetbl.Rows.Count - 1][0].ToString());
IdentityValue += 1;
}
and also.. the stack exception shows error in this method too..
and the line is marked with two **
private bool CheckDuplicates(System.Data.DataTable dtCheckDuplicates)
{
DataTable dtDuplicateRecords = dtCheckDuplicates.Clone();
bool blnCheckDuplicate;
for (int iRow = 0; iRow <= dtCheckDuplicates.Rows.Count - 1; iRow++)
{
blnCheckDuplicate = false;
** string strCheckRow = string.Empty;
object[] arr = dtCheckDuplicates.Rows[iRow].ItemArray;
for (int iColumn = 0; iColumn <= arr.Length - 1; iColumn++)
{
if (dtCheckDuplicates.Columns[iColumn].ColumnName.Trim().ToUpper() != "SNO")
{
if (iColumn != arr.Length - 1)
strCheckRow += dtCheckDuplicates.Columns[iColumn].ColumnName + " = '" + arr[iColumn].ToString() + "' and ";
else
strCheckRow += dtCheckDuplicates.Columns[iColumn].ColumnName + " = '" + arr[iColumn].ToString() + "'";
}
}
if (dtDuplicateRecords.Select(strCheckRow).Length > 0)
{
blnCheckDuplicate = true;
}
if (!blnCheckDuplicate)
{
DataRow[] drs = dtCheckDuplicates.Select(strCheckRow);
if (drs.Length > 1)
{
lblError.Text = "";
lblError.Text = AdhocConstants.DuplicateTravelPlan;
return true;
}
}
}
return false;
}
thnks for the help..
|
|
|
|
|
I've never done search-related.
the search-content contains: musics,pictures,peoples etc.
so I have a few questions.
Search content from multiple tables and multiple Fields.
I do full-text indexing of these fields.
If I need to create a view that contains these fields?
then I write sql "select" from this view.
is right?
I hope someone can give a guiding learning resources.
Thanks.
|
|
|
|
|
Hi,
I wan`t to use URL rewriting to map my requests to other page. for eg:
http://mydomain.com/101120/54623/Invoice_14235.zip
to
http://mydomain.com/Download.aspx?a=101120&b=54623&c=Invoice_14235.zip
Can anybody suggest how this can be done more efficiently and are there any microsoft tools (3rd party is not allowed in my project).
Any suggestions wold be welcomed.
When you fail to plan, you are planning to fail.
|
|
|
|
|
|
Hi all,
In my application i am opening a window through javascript from the code behind on the click event of an asp button.
But the problem is when i am placing the button inside an update panel the window is not opening.otherwise it is working.
Can anybody give me any way to solve it.
|
|
|
|
|
Are you Registering any startup event for the Button in the codebehind to open the window?
If yes, ClientScript class would not work in UpdatePanel. You ScriptManager's Register function.
|
|
|
|
|
its because when postback occurs it removes javascript so to resolve this problem you require to register click event of the button again.
For more help : pranayamr.blogspot.com
|
|
|
|
|
Can you post your code snippet? This will help us in answering..
Cheers!!
Brij
<a href="http://www.codeproject.com/KB/aspnet/asp_net4_0_URLRouting.aspx">Check my latest Article :URL Routing with ASP.NET 4.0</a>
|
|
|
|
|
|
|
thanks and cheers........
Rating always..... WELCOME
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
|
I m working on DataList. I have added one DropDownList in HeaderTemplate od DataList
<headertemplate>
|
|
|
|
|
Hi,
I am working with the HTTP Post method to log the user into my framework. But when I run the page it does not redirect to the Page given in URL. What I am doing wrong?
Following is my code:
string strResponse;
string strPost;
protected void Page_Load(object sender, EventArgs e)
{
strPost = "txtUserName=abc&txtPassword=123";
UTF8Encoding objUTFEncode = new UTF8Encoding();
byte[] arrRequest = null;
Stream objStreamReq;
StreamReader objStreamRes;
HttpWebRequest objHttpRequest;
HttpWebResponse objHttpResponse;
Uri objUri = new Uri("http://www.mysite.com");
objHttpRequest = HttpWebRequest.Create(objUri) as HttpWebRequest;
objHttpRequest.KeepAlive = false;
objHttpRequest.Method = "POST";
objHttpRequest.ContentType = "application/x-www-form-urlencoded";
arrRequest = objUTFEncode.GetBytes(strPost);
objHttpRequest.ContentLength = arrRequest.Length;
objStreamReq = objHttpRequest.GetRequestStream();
objStreamReq.Write(arrRequest, 0, arrRequest.Length);
objStreamReq.Close();
CookieContainer cookieContainer = new CookieContainer();
objHttpRequest.CookieContainer = cookieContainer;
//Get response
objHttpResponse = objHttpRequest.GetResponse() as HttpWebResponse;
objStreamRes = new StreamReader(objHttpResponse.GetResponseStream(), Encoding.ASCII);
strResponse = objStreamRes.ReadToEnd();
objStreamRes.Close();
}
Thanks
|
|
|
|
|
Dot-Net-Dev wrote: What I am doing wrong?
First, you are not following the guidelines for posting here. Use the pre tags to format any code you post.
Of course it's not redirecting because you are not telling it to. All you are doing is writting, or attemtpting to, the content of the web request to the output stream of the same page. This is NOT the way to a redirect. Use Response.Redirect.
This is also not the way to authenticate users. I suggst you read up on forms based authentication.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi,
I am trying to use user control event in the aspx page. I have two textboxes txt1 and txt2. txt1 is in user control(ascx) page and txt2 is in aspx page. Now with ascx page, i have one popup calender say calender1 too. Now when i click that calender1, both textboxes should show the selected date. How to do that? I can show the date in the textbox txt1 but how to do it for txt2?
thanks
suchita
suchita
|
|
|
|
|
If you are using JavaScript then get access to the textbox (document.getElementById(...)) and set the value.
If you using a postback then you need to expose an event on the user control that the main page can subscribe to so it can receive a notification to set the text.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
can you give me some examples please ?? ok lets say there is a button btn1 in ascx page and textbox txtbox1 in aspx page. When i click the button btn1, txtbox1 should show "hello". so in this case, how to do it ?
suchita
|
|
|
|
|
in your user control add a property like... (I assume that your user control has text box called txt1 )
private string displayText
public string DisplayText
{
get { return _displayText; }
set { txt1.Text = _displayText = value; }
}
now suppose your user control has name U1 , then just add U1.DisplayText = "something" along with txt2.Text = "something" in your aspx page. and you are all set.
|
|
|
|
|
the above code is written in which page ?
suchita
|
|
|
|
|
but where to keep this code? aspx or ascx.. can you clarify it please ?? also i dont know where to define _displayText ??
suchita
|
|
|
|
|
ok the property (code block) you need to put inside your user control ascx.cs and the setting of the property (that U1.DisplayText = "something") should be inside your aspx.cs,
in other words you add a property in the user control to just pass on the value you assign to the text box inside the user control, and then when you want to set the value, you use the user control name . dispalytext to assign the value to the text box inside the user control.
|
|
|
|
|
so
you mean
In ascx page,you include the following code ?
private string displayText ;
public string DisplayText
{
get { return _displayText; }
set { txt1.Text = _displayText = value; }
}
and what about in aspx page ??
and where to define _displayText ??
suchita
|
|
|
|