.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Post New Web Links

Problem reading my DLL

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
 
Hi there, I have a problem trying to display my DLL on Visual Studio 2005. I created a windows control library and I want to access it from my asp/c# website. I use the following code to display it: <object id="myComponent" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1" height="300px" width="100%" />However, when I run the website it just shows me a plain box. With nothing in it.Another thing, the VIEWASTEXT inserted in the object it gets underlined and when I roll the mouse over it says:"VIEWASTEXT attribute is not valid attribute of element 'object'"Can anyone help me go around this problem or fix it?Thank you in advance ;)


View Complete Post


More Related Resource Links

reading excel file problem

  

Hi,


i have 200 rows in my excel file. im using OleDbConnection to read the excel file.

The problem is that it will read all the blank rows from row 200 onwards. Is there a configuration im missing ? or is there a way to import all rows that has data? Here's some of my code.


string excelConnectionString =
               "Provider=Microsoft.Jet.OLEDB.4.0;" +
                "Data Source=" + filePath + ";" +
                "Extended Properties=Excel 8.0";

OleDbConnection excelConnection =
                    new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties='Excel 8.0;HDR=NO'");


OleDbCommand cmd = new OleDbCommand("Select * from [list$]",excelConnection);







Problem when using Activator.CreateObject and reading App.Config file

  
Hello, this is the scenario. I have an application that load at runtime severals dll. these dll are actually "adapters" that wraps calls to web services, database and so on. The app.config of the "main" application stores in config sections all information necessary to each adapter (i.e.Web ServiceURL..) and I have created inside each adapter a class to ready those values the loading at run time the DLL has been implemented by storing all necessary types into a dictionary of generics and when I need to instanciate it I call the Activate.CreateObject and I pass the specific type (I means the name of the Adapter class) The problem is that the adapter class itself is not able to get the config value because ConfigSection has not been initialized. If I write: IInterfaceAdap adapt = new myAdapter() -> I read the config data IInterfaceAdap adapt = (IInterfaceAdap)Activator.CreateObject (type) -> now way to read the data stored in the App.Config. I think that I undertood the problem but I'm not able to find a workaround to read data store in the app.config!! I need help please!!  

Problem reading from cookie

  
I'm trying to build a smaller shop and I have run into some problems with cookies. This is my code in the shoppingcartaccess classprivate static string shoppingCartId { get { // get the current HttpContext HttpContext context = HttpContext.Current; // try to retrieve the cart ID from the user cookie string cartId = context.Request.Cookies["CartID"].Value; // HERE I GET THE ERROR // if the cart ID isn't in the cookie... // check if the cart ID exists as a cookie if (context.Request.Cookies["CartID"] != null) { // return the id return cartId; } else // if the cart ID doesn't exist in the cookie as well, generate // a new ID { // generate a new GUID cartId = Guid.NewGuid().ToString(); // create the cookie object and set its value HttpCookie cookie = new HttpCookie("CartID", cartId); // set the cookie's expiration date int howManyDays = SiteConfig.CartPersistDays; DateTime currentDate = DateTime.Now; TimeSpan timeSpan = new TimeSpan(howManyDays, 0, 0, 0); DateTime expirationDate = currentDate.Add(timeSpan); c

DB Reading problem

  
I was having problem with my database, I couldn't see any of the table in the enterprise manager. when I execute any sql in some of the tables of the database it was giving error msf that "Bad Page Id". I went through the FAQs and Forums, I tried with this queries. ALTER DATABASE DMS_PILOT SET SINGLE_USER go DBCC CHECKDB (DMS_PILOT, REPAIR_ALLOW_DATA_LOSS) GO When I execute this query I found some new error messeges mentioned as below. "Server: Msg 8966, Level 16, State 1, Line 2 Could not read and latch page (1:3168) with latch type SH. sysindexes failed. DBCC execution completed. If DBCC printed error messages, contact your system administrator." Please help me.

DB Reading problem

  
I was having problem with my database, I couldn't see any of the table in the enterprise manager. when I execute any sql in some of the tables of the database it was giving error msf that "Bad Page Id". I went through the FAQs and Forums, I tried with this queries. ALTER DATABASE DMS_PILOT SET SINGLE_USER go DBCC CHECKDB (DMS_PILOT, REPAIR_ALLOW_DATA_LOSS) GO When I execute this query I found some new error messeges mentioned as below. "Server: Msg 8966, Level 16, State 1, Line 2 Could not read and latch page (1:3168) with latch type SH. sysindexes failed. DBCC execution completed. If DBCC printed error messages, contact your system administrator." Please help me.

problem reading from app.config

  

I have added an app.config file in my winform aplicaion an added one key

<add key="IsFirstRun" value="True" />

then I am tying to read it like this:

MessageBox.Show(ConfigurationManager.AppSettings["IsFirstRun"]);

but I am getting this error:

Configuration system failed to initialize

on the MessageBox line..

why? how ca I fix please?


Jassim Rahma

XMLDocument, problem reading Node.

  

Hello,

 

I am doing the following:

 

System.Net.WebRequest myRequest = System.Net.WebRequest.Create("http://www.atlantawithkid.com/feed/"); 
System.Net.WebResponse myResponse = myRequest.GetResponse(); 
 
System.IO.Stream rssStream = myResponse.GetResponseStream(); 
System.Xml.XmlDocument rssDoc = new System.Xml.XmlDocument(); 
rssDoc.Load(rssStream); 
 
System.Xml.XmlNodeList rssItems = rssDoc.SelectNodes("rss/channel/item"); 
System.Xml.XmlNode rssDetail; 
 
string sRssDescription;  
rssDetail = rssItems.Item(0).SelectSingleNode("description"); 
if (rssDetail != null) 
    sRssDescription = rssDetail.InnerText; 

However, when I read the "description" node and view the InnerText, or the InnerXML, the string is different than in the original XML document.

The string returned has and ellipses and the data is truncated. However, in the original XML document there is data that I can see.

Is there a way to select this node without the data being altered?

The original XML <description> node is as follows:

			<description xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" cf:type="html">
				<div class="tweetmeme_button" style="float:right;margin-le

StreamReader.BaseStream.Read() problem in Random access reading of file

  

I am trying to randomly access a file but not fully understanding this class.

I have

 // Seek to the beginning of the field

System.IO.StreamReader srFile = new System.IO.StreamReader(_FileName.PathAndFileName);

srFile.BaseStream.Seek(FieldOffset, SeekOrigin.Begin);







// Read the field



int FieldLength = Field.FieldLength;  







int BUFFER_SIZE = (int)RecordLength;



byte[] bBuffer = new Byte[BUFFER_SIZE];



srFile.BaseStream.Read(bBuffer, 0, (int)FieldLength);



srFile.Close();
string FieldValue;
FieldValue = bBuffer.ToString();

but bBuffer is numbers like:

[0] 32
[1]32
[2]32
etc..

and the value of FieldValue is "System.Byte[]"

I'm trying to get text as this is a text file.

 


Problem in reading WCF configuration settings

  

Hi,

The great thing about WCF is that you can configure you're WCF bindings in a configuration file and not through code.
We are now making connection to WCF's webservices in our SharePoint code, but now the question is where to place the WCF configuration settings. 

 

For deployment reasons we don't want to place the settings in the SharePoint web.config:

-  can't be easily changed by admin users through SharePoint Gui

-  new deployment needed to change configuration settings

-  webservices u

SSIS 2008: Problem reading dynamic file during execution

  

Hello,

I have a SSIS 2008 project that reads a bunch of files from a file (always the same file) from Machine A.
My package is running on Machine B and this is where the information is being imported to, my Reporting DB (sql 2008) is also located in Machine B. 
I have a dynamic log file that stores the execution errors every time the package is executed and its name is made up of the timestamp of when package starts executing. The "DelayValidation" option for this connection is set to "TRUE". When i execute my Package from Visual Studio 2008, it runs without a problem.
The problem is when i deploy my package into SQL Server 2008 and try running it through DTEXEC. I always get the following error:

 

Error: 2010-11-03 14:57:29.06
   Code: 0xC001401E
   Source: MyImportPackage Connection manager "ImportLog"
   Description: The file name "\\ip-address\d$\Logs\ImportManager\20101103_145726.txt" specified in the connection was not valid.

Problem while reading a Facebook RSS feed using SyndicationFeed

  

Hi,
I am trying to read a Facebook RSS feed using the SyndicationFeed class. I have tried to do the following:
string url = "http://www.facebook.com/feeds/page.php?format=atom10&id=147782351928125";
XmlReader xmlReader = XmlReader.Create(url);

SyndicationFeed feed = SyndicationFeed.Load(xmlReader);
foreach (SyndicationItem item in feed.Items)
 Console.WriteLine(item.Title.Text);

But the load method throws this exception:
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.

I have also tried to add a XmlReaderSettings as suggested, but it just throws different errors. Any ideas?

Thanks
Henrik


problem in reading event logs of remote machine

  

hi,

I work on application which connects to remote machine and retrieves all event logs from it using EventLogReader and EventLogQuery classes.

I use the API EventLogReader.ReadEvent() for it. It works fine on all platforms except on Windows 7 machine. If I run my application on Windows 7 machine, EventLogReader.ReadEvent() throws an EventLogException with the error message - "The array bounds are invalid"

Have anyone faced this issue before? How I can overcome this problem and continue reading next event logs?

Please let me know.

 

Thanks!

Amit


Problem reading an XML file with a DTD attached

  

 Hello Everyone;

I have a very big issue that I could use some help on. I have a Handler that receives a transmission of an XML data through a HTTP Post. This works fine now but I have an issue reading the XML data and parsing it down. The following is a sample of the XML data that I have no control over. It comes from a third party so changing the data will not happen.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xiamSMS SYSTEM "xiamSMSMessage.dtd">
<xiamSMS>
     <deliverRequest id="1">
           <from>John Doe</from>
           <to>Tim Burton</to>
           <content type="text">TEST DATA</content>
      </deliverRequest>
</xiamSMS>

I have tried using an XMLTextReader to load the XML and parse it, but this seamed to fail on the DocType line of the XML due to the DTD file reference. After some more research I switched to the following code believing that it will solve the failing on the DocType of the DTD file.

XmlReaderSettings smsXMLset = new XmlReaderSettings();

Problem with WCF: Error while reading message framing format at position 13665 of stream (state: Rea

  

Hi,

we're using the net.tcp binding, server is self-hosted.

One of our clients experience the following problem randomly appearing on each client couple of times a day:

System.ServiceModel.ProtocolException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Error while reading message framing format at position 13665 of stream (state: ReadingEnvelopeBytes)

The exception appears on the client. I analyzed the WCF trace of the server and there are no exceptions.

What can be the cause of the exception?

I'd really appreciate any help, because the client is in production and this brings lots of problems.

Thanks!


Problem with reading byte array from stream in WCF Service

  

Hello i have WCF Service and at some point of my program i am getting pointer to byte array. I want to copy bytes from this byte array/pointer to another byte array and send it to client.

 

// EDIT : THis code is TOTALLY wrong  please see post under to see code and proper problem. Sorry for mistake.

 byte[] arrbyt = new byte[params.ActualSize + 1];
 int isize = Marshal.SizeOf(typeof(byte))*arrbyt.Length;
 IntPtr pt = Marshal.AllocHGlobal(isize);

 int ind = 0;
 while (read != 0)
 {
 str.RemoteRead(out *(byte*)pt, size, out read);

 }
 Marshal.Copy(pt, arrbyt, 0, isize);

//after that arrbyt is still empty but pt has good values in it. I tryied also with stackalloc and then IntPtr to it and then Marshal.Copy but the result was the same.

//Does any one had similar problem or have an idea how to copy bytes from pt to other array?

//edit RemoteRead is like ISequentialStream::Read M

Problem to group radio button across gridview rows

  
In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

  
http://emanonsolutions.blogspot.com/
We can write your question and problem on this blogger.you get ans.use.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend