Click here to Skip to main content
15,897,032 members

Comments by aksjustcool (Top 3 by date)

aksjustcool 13-Jul-15 8:38am View    
Suppose I have such 3 Script Number:
1001
1002
1003

On invoking each of them (One by one using foreach loop)we will land up on three respective different pages, but only the last page i.e. for script 1003 is seen.

I am unable to load the other two pages on webbrowser. Only the last page is being loaded. Is there any alternative or JavaScript Loadcomplete method which can help me around this?
aksjustcool 12-Jan-15 1:23am View    
Hi Jymmy097, thanx for your input will remember this. I have just updated my question. Kindly share your input for this Thanx
aksjustcool 19-Nov-14 11:49am View    
///app.config

<configuration>
<appsettings>
<add key="Connstr" value="SERVER=192.168.1.4;database=RenfroERP;uid=appdev;pwd=appdev">
<add key="Connstr2" value="Server=192.168.1.6\SQLExpress;database=EkatmERP;uid=EkatmSA;pwd=EkatmSA">



///databaseconn.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace ExcelBeginner
{
class Query
{
public DataTable MyDataTable(string query, string Connstr)
{
try
{
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(query, Connstr);
da.Fill(dt);
return (dt);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
}

////program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace BeginExcel
{
static class Program
{
///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new RzExcel());
}
}
}


//// Excel.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Diagnostics;
using Excel = Microsoft.Office.Interop.Excel;

namespace BeginExcel
{
public partial class RzExcel : Form
{
public RzExcel()
{
InitializeComponent();
}

object misValue = System.Reflection.Missing.Value;
ExcelBeginner.Query objQuery = new ExcelBeginner.Query();

public void CreatExcelFromDB(string sqlquery, string Connstr, string FileName)
{

SqlDataAdapter DA = new SqlDataAdapter(sqlquery, Connstr);
DataSet DS = new DataSet();
DA.Fill(DS);
CreateExcel(DS, FileName);
}
public void CreatExcelFromDS(DataSet DS, string FileName)
{
CreateExcel(DS, FileName);
}
public DataSet ExcelToDT(string _Location)
{
DataSet ds = new DataSet();
var excelConnectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0", _Location);
System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection();
connection.ConnectionString = excelConnectionString;
DataTable sheets = GetSchemaTable(excelConnectionString);

foreach (DataRow r in sheets.Rows)
{
string query = "SELECT * FROM [" + r.ItemArray[0].ToString() + "]";
ds.Clear();
System.Data.OleDb.OleDbDataAdapter data = new System.Data.OleDb.OleDbDataAdapter(query, connection);
data.Fill(ds);

}

return ds;
}




private static void WriteArray(int rows, int columns, Excel.Worksheet worksheet)
{
var data = new object[rows, columns];
for (var row = 1; row <= rows; row++)
{
for (var column = 1; column <= columns; column++)
{
data[row - 1, column - 1] = "Test";
}
}

var startCell = (Excel.Range )worksheet.Cells[1, 1];
var endCell = (Excel.Range )worksheet.Cells[rows, columns];
var writeRange = worksheet.Range[startCell, endCell];

writeRange.Value2 = data;
}
static DataTa