|
Thnx Sir,i tried but i got:
BC30451: Name 'IFF' is not declared.
i tried : Checked="<%# IF((Container.Value = "True"), true, false)%>" />
i got the old error : BC30201: Expression expected.
|
|
|
|
|
alaminfad wrote: i tried : Checked="<%# IF((Container.Value = "True"), true, false)%>" />
mm, try this -
Checked="<%# IF(Container.Value = "True") Then True Else False)%>"
|
|
|
|
|
hello,
i wants to dowload data from one website link with d help of OleDbConnection
Link from which i want data is http://www.cboe.com/LearnCenter/pricehistory.xls[^]
i have did as followes :
string sFileName = "http://www.cboe.com/LearnCenter/pricehistory.xls";
string connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = {0}; Extended Properties=Excel 8.0;", sFileName);
OleDbConnection objConn = new OleDbConnection(connectionString);
using (objConn)
{
objConn.Open();
System.Data.DataTable dtSheetData = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
String[] excelSheets = new String[dtSheetData.Rows.Count];
// Add the sheet name to the string array.
foreach (DataRow row in dtSheetData.Rows)
{
excelSheets[iSheetCount] = row["TABLE_NAME"].ToString();
iSheetCount++;
}
OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM [" + excelSheets[0] + "] ", objConn);
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter(objCmdSelect);
excelData = new System.Data.DataTable();
objAdapter1.Fill(excelData);
objConn.Close();
}
but it giving me an error at objConn.Open();
wht i have to do??
|
|
|
|
|
Mugdha_Aditya wrote: but it giving me an error at objConn.Open();
Well, we can either spend the rest of the day guessing, or you could tell us the FULL error message, including any inner exceptions. I suspect the latter will help us to help you rather quicker.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Error as
Invalid internet address.
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at PrjBussExtEltParser.clsBussExtEltParser.USElementsDataExcel(DataSet dsElements) in C:\Projects\DailyUpdatesExtEleSchedule\PrjBussExtEltParser\clsBussExtEltParser.cs:line 1275
at PrjBussExtEltParser.clsBussExtEltParser.USElementsData(Boolean bIsHistoric) in C:\Projects\DailyUpdatesExtEleSchedule\PrjBussExtEltParser\clsBussExtEltParser.cs:line 1253
at DailyUpdatesExtEleSchedule.Form1.GetUSElementData() in C:\Projects\DailyUpdatesExtEleSchedule\DailyUpdatesExtEleSchedule\Form1.vb:line 2188
|
|
|
|
|
What is the Error ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Error as
Invalid internet address.
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at PrjBussExtEltParser.clsBussExtEltParser.USElementsDataExcel(DataSet dsElements) in C:\Projects\DailyUpdatesExtEleSchedule\PrjBussExtEltParser\clsBussExtEltParser.cs:line 1275
at PrjBussExtEltParser.clsBussExtEltParser.USElementsData(Boolean bIsHistoric) in C:\Projects\DailyUpdatesExtEleSchedule\PrjBussExtEltParser\clsBussExtEltParser.cs:line 1253
at DailyUpdatesExtEleSchedule.Form1.GetUSElementData() in C:\Projects\DailyUpdatesExtEleSchedule\DailyUpdatesExtEleSchedule\Form1.vb:line 2188
|
|
|
|
|
What is this
Data Source = {0}
You can add just anything in the Connection string
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i have got tht code from online..so i dnt knw..
|
|
|
|
|
The Datasource Should be the name of your SQL instance, but that is incorrect just change it to the name of your SQl instance and try it again
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
<add name="DbIndigoTrack" connectionString="Data Source=192.168.1.7\indcountry; Initial Catalog=Data_Team ; User ID=devuser; Password=devuser@reval" providerName="System.Data.SqlClient"/>-->
tht is my connection string
i hve replaced code as
string connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; Data Source = 192.168.1.7\indcountry; Extended Properties=Excel 8.0;", sFileName);
still there is error as Cannot update. Database or object is read-only.
|
|
|
|
|
ok now tell me
192.168.1.7\indcountry
The above Server name , Go to SQl Management Studio and try to connect to SQl using that in the server option and tell me if it connects , use the same credentials that you used in the above connection string.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
no use...
still its giving error
Data Source ={0}
means...it will take file name
http://www.cboe.com/LearnCenter/pricehistory.xls
Provider=Microsoft.Jet.OLEDB.4.0; Data Source =http://www.cboe.com/LearnCenter/pricehistory.xls; Extended Properties=Excel 8.0;
like this....
|
|
|
|
|
If file is saved on my location machin..n if i have given path of tht
then it works..grd...
but for this its nt working...
may b i have to save tht file first in default location
do u know..hw to save file in default loaction without opening it..
|
|
|
|
|
Your Question was not clear from the Start now i see what is your Problem. You are Uploading the Excel file and the file does not Exists on the Server. What you need to do is to copy the file to the Server save it in the App_Data Folder and Processes it from there.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
sorry for inconvinence
but i wants to save that files through coding..code behind
how to do tht??
dnt want to open it..but i have to save tht file in default location...how to do tht through coding
i dnt want to create xcel object..bcz i have to update huge data with diff excel
so it will create prb if excel create objects
so..without creating excel object how to save file in default location?
|
|
|
|
|
Hey you cant have direct access to a file using web address like
http://www.cboe.com/LearnCenter/pricehistory.xls
You need to download the file to your local system and then you can use MDAC to access its data.
|
|
|
|
|
can i save tht excel in server side..through coding??
if yes thhn hw to do tht??
|
|
|
|
|
|
I want to know..without opening hw to save XLS File at default location
|
|
|
|
|
|
Heyyyyyyyyy......
Thanks a lotttttttttt
it works now...
thnku so much
|
|
|
|
|
You are most welcome...
And ...
Dont forget to click on Good Answer if it helps you.
|
|
|
|
|
Hi Dudes, Plz Solve these
I am trying to implement a sample report in asp.net using crystal reports10.0.
But i get an error of Object reference not set to an instance of an object
Here's my code
public void btn_Click(object sender, EventArgs e)
{
frmPreview Preview = new frmPreview();
rptInformation Info = null;
TableLogOnInfo logOnInfo = DBManager.getCrystalLogInfo();
Info = new rptInformation();
Info.Database.Tables[0].ApplyLogOnInfo(logOnInfo);
formulaFieldDefs = Info.DataDefinition.FormulaFields;
formulaFieldDef = formulaFieldDefs["CompanyName"];
formulaFieldDef.Text = "'" + Global.CompanyName + "'";
Preview.crystalRptViewer.ReportSource = Info;
}
Here I placed CrystalReportViewer in frmPreview
|
|
|
|
|
It seems that you are doing this in Winforms...
I think this is not the right section to post this.
On this ... you didnt mentioned where exactly the error you are getting...?
|
|
|
|