Showing posts with label index. Show all posts
Showing posts with label index. Show all posts

Thursday, March 29, 2012

Formula Field

I'm using the crystal report of VB.Net 2005 I've tried to write
ReportInstance.DataDefinition.FormulaFields(index).Text = "{DataTable.ColumnName}"
but it didn't work ,I've found that FormulaFields is read only,is there a way to do my point,I mean I need to assign column names of a datatble to the FormulaField(index).Try this, the following code has always worked for me:

For Each crxFormulaField In crxReport.FormulaFields
Select Case crxFormulaField.Name
Case "{@.YourFormulaName}"
crxFormulaField.Text = "{DataTable.ColumnName}"
End Select
Next crxFormulaField

Good luck!
-- Heather

Wednesday, March 7, 2012

Format of the initialization string does not conform to specification starting at index 0.

can't figure out this error. i think i'm writing something wrong in the connnection string. i'm using SQL Server Express, if that helps.

in my config file:

<connectionStrings>
<add name="OfficialScribblerConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\OfficialScribbler.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

in my aspx file:

Dim DBConnection = New OleDbConnection("OfficialScribblerConnectionString")

DBConnection.Open()

Dim SQLString As String = "SELECT PostedDate From Entries_tbl ORDER BY PostedDate"

Try this way

Dim DBConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings("OfficialScribblerConnectionString").ConnectionString)

Hope this will help you

|||thanks for the tip. i will try later on and let you know how it goes.|||

i tried that and now the error says this:

An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

|||

Change the connection string as

<

addname="OfficialScribblerConnectionString"connectionString="Provider=SQLOLEDB;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\OfficialScribbler.mdf;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient"/>Change the code to

Dim

DBConnectionAsNew OleDbConnection(ConfigurationManager.ConnectionStrings("OfficialScribblerConnectionString").ConnectionString)

DBConnection.Open()

Hope this will help you.

Let me know if you need any further help