The ConnectionString property has not been initialized

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 1
Reputation: harsha_abraham is an unknown quantity at this point 
Solved Threads: 0
harsha_abraham harsha_abraham is offline Offline
Newbie Poster

The ConnectionString property has not been initialized

 
0
  #1
Nov 15th, 2008
I am getting the following error

“The ConnectionString property has not been initialized’, while executing the below portion of code.checked that the below connection string is having value and not null.

(Data Source=NAWINSQL050;Initial Catalog=AlbatrossDB; Integrated Security=true)


objFormatOut = FormatDepartment.Format.FormatSelectById(m_intOutputFormat, oConn)<—--error occurs(The ConnectionString property has not been initialized’)


in the below section the same stored proc is execurted with out any error.

If m_intOutputFormat = 218 Then
oDS = oDataAccess.ExecuteDataset(oConn, "Stored Procedure", m_intProcYear, m_shtProcMonth, m_strSupplierId, m_strDistId, m_strDestinationCd)

Else
oDS = oDataAccess.ExecuteDataset(oConn, "Stored procedure", m_lngSourceOutputId, m_strSupplierId, m_strDistId,

m_strDestinationCd) <—--same connection string works here in this line and stored procedure executed

End If

Please advise as to what can be the issue and how this can be resolved ?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 32
Reputation: reena12 is an unknown quantity at this point 
Solved Threads: 4
reena12 reena12 is offline Offline
Light Poster

Re: The ConnectionString property has not been initialized

 
0
  #2
Dec 8th, 2008
Hi,
oConn.open() statement is missing

(Data Source=NAWINSQL050;Initial Catalog=AlbatrossDB; Integrated Security=true)

oConn.open()

objFormatOut = FormatDepartment.Format.FormatSelectById(m_intOutputFormat, oConn)

If m_intOutputFormat = 218 Then
oDS = oDataAccess.ExecuteDataset(oConn, "Stored Procedure", m_intProcYear, m_shtProcMonth, m_strSupplierId, m_strDistId, m_strDestinationCd)

Else
oDS = oDataAccess.ExecuteDataset(oConn, "Stored procedure", m_lngSourceOutputId, m_strSupplierId, m_strDistId,

m_strDestinationCd)

End If
Reena Mehta

Remember to click on Mark as answer on the post that helped

http://www.indianic.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC