|
Hi Samiullah,
this has nothing to do with the connection string. The program is missing an object, where an object is expected it is null. Check the exception details for the line in the code where the exception is thrown. This will give you a hint which object is missing.
Regards
Sebastian
|
|
|
|
|
The error as follow...
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 720: private void InitConnection() {
Line 721: this._connection = new global::System.Data.SqlClient.SqlConnection();
Line 722: this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["AdventureWorksConnectionString"].ConnectionString;
Line 723: }
Line 724:
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\products\7bb3ee42\1a34f12b\App_Code.3orrxfoa.2.cs Line: 722
|
|
|
|
|
Check the connection string. Enter valid credentials, and database name.
Cheers,
Sudhanva
|
|
|
|
|
Good afternoon everyone ,
I have created a class library in C#.NET.
That contains one class MyClass.
i want to create instance of this class inside javascript.
Can anybody tell me what are the necessary steps and precautions i have to take !!
MyClass.cs
public class MyClass
{
string m_filePath ;
MyClass()
{
this.m_filePath =String.Empty;
}
MyClass(string _filePath)
{
this.m_filePath =_filePath;
}
}
and the instance should call parameterised ctor.
var obj = new MyClass("c:\\"); -> what should be JS code.
Thanks in Advance........
DaTtA
way2datta@gmail.com
|
|
|
|
|
Dattatraya Kale wrote: and the instance should call parameterised ctor.
var obj = new MyClass("c:\\"); -> what should be JS code.
Why you are trying this ?
If you want to pass client side variable to C# class, use HiddenField, Store values in hidden field and access from C# class from code behind .
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
Thanks a lot for yr reply
but i do want to call that dll from client side
and not from server side.
|
|
|
|
|
Dattatraya Kale wrote:
but i do want to call that dll from client side
Then you can use ActiveXObject .
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
Thanks once again .
yup i tried that approach but i am missing something related with dll.
When i try to create instance it is giving javascript error
"Automation server can't create object."
Please give me Steps to create dll.
and sample code ..
Thanks in advance !!
DaTtA
way2datta@gmail.com
|
|
|
|
|
|
Hai,
I have a user control in my master page,which shows the company logo based on the language selected from the dropdown in the content page,the logo comes dynamically from different language folders,I update a session variable when I change the language in the dropdown,but when I update the language the user control is not getting refreshed,only reloading the page changes the logo.
cheers,
Thomas.
|
|
|
|
|
Hi Thomas,
Add following code where you update the Session variable.
Response.Redirect(Request.Url.ToString());
Thanks,
Padmanabh Ganorkar
|
|
|
|
|
Hai,
if (ddl_language.SelectedItem.Value.ToString() != "0")
{
HttpCookie cookie = new HttpCookie("viterion_app_language");
cookie.Value = ddl_language.SelectedItem.Text.ToString();
cookie.Expires = System.DateTime.Now.AddDays(365);
Response.Cookies.Add(cookie);
}
From this cookie, the session varible is updated in the master page through the init event.
The code is
HttpContext.Current.Session.Add("app_language", HttpContext.Current.Request.Cookies["viterion_app_language"].Value);
cheers,
Thomas.
|
|
|
|
|
what your code ?
|
|
|
|
|
Hi,
I want to hide the toolbar and menu bar address bar, when my webpage is loaded.that is immediately after the URL is requested.I am using ASP.NET(C#). And also need to block the F5 KEY coz its a shortcut for refresh.
reply ASAP.
THANKS IN ADVANCE
zari
|
|
|
|
|
why u wana do this . u can simply search from google
|
|
|
|
|
I used this script,
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top=0,left=0,scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open('Login.aspx',myname,settings);}
and called the function in onload of tag..... but it keeps on loading again n again
zari
|
|
|
|
|
Hi,
I am using WebBrowser Control and passing the url at run time.
I want to insert some text or javascript into the body of the web page being loaded in the browser.
I tried like below.
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
WebBrowser browse = (WebBrowser)sender;
if (!(webBrowser1.Document.Body.InnerHtml.Contains("Hello")))
{
webBrowser1.Document.Body.InnerHtml = browse.Document.Body.InnerHtml + "<script type='text/javascript'> var Hello; var i; var totalTable = document.getElementsByTagName('table').length; for(i=0;i < totalTable; i++) { document.getElementsByTagName('table')[i].id = 'name' + i; } function myfun() { this.style.border = 'solid 5px Red'; } function myfun1() { this.style.border = 'none'; } for(i=0;i < totalTable; i++) { document.getElementsByTagName('table')[i].onmouseover = myfun; document.getElementsByTagName('table')[i].onmouseout = myfun1; } </script>";
}
}
But, This is not working. This event is fired many times for single page.
Thanks,
Nagaraj
|
|
|
|
|
Hi all,
I have a dataview which contains song titles retrived frm the database and when user click on the play button on each row corresponding song should play.
How can i do the same
Thanks in advance
|
|
|
|
|
u simplay drag drop the sound file and declare them in program.
|
|
|
|
|
I didnt get u can u please give a detailed description please..
|
|
|
|
|
hi Friends ,
I have to make an assignment where i have to insert date in a textbox from a calender calender(ASP.Net.plz send me coding if any one can.
|
|
|
|
|
jasjit jas wrote: I have to make an assignment where i have to insert date in a textbox from a calender calender(ASP.Net.plz send me coding if any one can. Wink
So you want some one else do your home work . I suggest Please Buy a Beginner's ASP.Net Books .
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
jasjit jas wrote: insert date in a textbox from a calender calender
under Calendar1_SelectionChanged event write this snippet
textbox1.Text = Calendar1.SelectedDate.ToString();
hope this helps
Regards,
SunilWise
|
|
|
|
|
I am glad to help you,please contact me with MSN:mazk_good@hotmail.com
|
|
|
|
|
Hi all,
I have a problem with cookies.
I use a cookie with key/value pairs for storing articles.
I have a button "Add article" which adds a key/value pair to the cookie.
When the page reloads I need to access all the values in the cookie and display them.
the problem is that when the button is clicked the cookie is added to the Response and will not be present in the Request until another reload since - I guess - the button event handler is being executed during the page load.
If I add an article it won't show up until I do another reload on the page.
Does anybody have an idea how I can add the cookie with a button and have the value in the Request when the page loads next time.
Hope someone out there understands what I'm trying to explain.
Thank you for your help!!
|
|
|
|