Tuesday, February 28, 2012

Oracle related Issues

1:- In cmd check "echo %PATH%"  to get the environment variables with path .
2:-Start - Run - %windir%\SysWOW64\odbcad32.exe to get the providers registered with 32 bit.
3:-First time we r installing Oracle client need to configure tns names through NetConfigurationWizard.It will generate one tnsnames file in that specific location .IT contains the server name and all details.

Export to CSV

HttpContext.Current.Response.Clear()
HttpContext.Current.Response.Buffer =
TrueHttpContext.Current.Response.AddHeader(
HttpContext.Current.Response.Charset =
"content-disposition", "attachment;filename=GLAmountsExport.csv")""HttpContext.Current.Response.ContentType = "application/text"
dt = GetXRefDataPageWise()
Dim dt As DataTable' GridView1.AllowPaging = False' GridView1.DataBind()

sb.Append(dt.Columns(k).ColumnName +
Dim sb As New StringBuilder()For k As Integer = 0 To dt.Columns.Count - 1","c)Nextsb.Append(vbCr & vbLf)


sb.Append(dt.Rows(i)(k).ToString +
For i As Integer = 0 To dt.Rows.Count - 1For k As Integer = 0 To dt.Columns.Count - 1","c)Nextsb.Append(vbCr & vbLf)
NextHttpContext.Current.Response.Output.Write(sb.ToString())
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()

Need to add  ","+c to display the values correctly in csv file .