ciao
ho problemi con la connection string di un sito web.
Uso la Page per configurarla...........
sugli altri pannelli di controllo usavo il web config, mentre in questa volevo inserire direttamente sulla page il la connection string.......
errorre riscontrato:
[code]
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:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
MyArtistic.Page5.Page_Init(Object sender, EventArgs e) in C:\Users\nena\Desktop\artistic\My-Artistic\ProgettoVB\MyArtistic\MyArtistic\MyArtist icPannello\Page5.vb:17
System.Web.UI.Control.OnInit(EventArgs e) +99
System.Web.UI.Page.OnInit(EventArgs e) +9
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +834
[/code
]
il codice che non funziona:
objdb.ConnectionString = ConfigurationManager.ConnectionStrings("Data Source=WIN3854\SQLEXPRESS,1433;Initial Catalog=MyArtistic;Persist Security Info=True;User ID=MArtistic;password=Arte422").ConnectionString
Dove ho sbagliato ??
elena