Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / March 2007

Tip: Looking for answers? Try searching our database.

missingmanifestresourceexception with web usercontrol (VB2005)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alexbelli@nospam.nospam - 02 Mar 2007 09:07 GMT
VB2005, web page
I add a single usercontrol, then I select to project the component ( i dont'
know the  menu name in english, in my italian VS the menu is "progettazione
componente")
I put on it a sqlconnectionn and a sql data adapter.
I configure sql data adapter to read and save data to a sql table.
if I select the option "update dataset" on insert command is added ";select
.... where id=scope_identity()" to update the id generated on insert (id in
a auto incr. field)

With this option,  then query is not written by the ide like

Me.sqlInsertCommand.CommandText ="Insert into......; select .... where
id=scope_identity()"

but I find
Me.sqlInsertCommand.CommandText
=resources.GetString("sqlInsertCommand.CommandText")

and on e usercontrol.resx I see the query written in clead

When from the asp page I call  initializecomponent, i have the error
"missingmanifestresourceexception"

The same happens if I inset in project a class, then I inherits from
System.ComponentModel.Component,
I put sql connection and adapter.

Why the ide put the query on a resx file?
What I have to do to avoid this, or in any case to avoid the runtime error?

Thank you
Alessandro
WenYuan Wang - 05 Mar 2007 08:58 GMT
Hi Alessandro,
Thanks for your post.

We need to perform more research on this issue . We will reply here as soon
as possible.
If you have any more concerns on it, please feel free to post here.

Thanks again for your understanding!
Best regards,
Wen Yuan
WenYuan Wang - 05 Mar 2007 12:25 GMT
Hi Alessandro,
Sorry for the late reply.

I'm not sure whether I have understood your issue completely. Do you mean
you created a Winform User Control and want to use it in ASP.net Project?  
As far as I know, the Winform User Control cannot be used in ASP.Net
Project, expect for "IE host usercontrol". (Did you use IE host
usercontrol?) In general, if you want to create a User Control in ASP.net
Web Application, we would like to suggest using "Web User Control". If I
have misunderstood anything here, please don't hesitate to correct me.

By the way, in Winfrom User Control, the query commandtext will be inserted
into the .resx file. This is by design, I'm afraid we cannot change this
behavior so far. Additionally, if you didn't like command load the query
string from .resx file, you can manually replace the
Me.sqlInsertCommand.CommandText
=resources.GetString("sqlInsertCommand.CommandText")
with
Me.sqlInsertCommand.CommandText ="Insert ... ".
But this method is not recommendable. We don't suggest to modify the code
generated by VS.

Would you please provide some detailed information for us? Such as how you
create the user control (WinForm or WebForm). Is it an "IE host
usercontrol"? We are glad to assist you.

Have a great day,
Sincerely,
Wen Yuan
alexbelli@nospam.nospam - 07 Mar 2007 12:40 GMT
Hello!
Thank you for your answer
I try to explain better
I am working with a asp net 2 project and a web custom control.
I find a lot of similar cases on internet:
look at http://forums.asp.net/thread/1305510.aspx, it's quiet similar to
mine

The problem happens ONLY When the VS put the query text on resx file, (as
you can see on my example it's happen with Me.sqlInsertCommand1.)

it seems that the command
Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(WebUserControl))

is does not work properly.

Thank you for you help

Example:

Partial Class WebUserControl
Inherits System.Web.UI.UserControl

Private Sub InitializeComponent()

Dim resources As System.ComponentModel.ComponentResourceManager = New
System.ComponentModel.ComponentResourceManager(GetType(WebUserControl))

Me.sqlSelectCommand1 = New System.Data.SqlClient.SqlCommand

Me.sqlInsertCommand1 = New System.Data.SqlClient.SqlCommand

Me.sqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand

Me.sqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand

Me.sqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter

Me.sqlConnection2 = New System.Data.SqlClient.SqlConnection

'

'sqlSelectCommand1

'

Me.sqlSelectCommand1.CommandText = "SELECT id, nome, cognome, telefono1,
telefono2, email, note, datainserimento" &
Global.Microsoft.VisualBasic.ChrW(13) &
Global.Microsoft.VisualBasic.ChrW(10) & "FROM anagrafica_web"

Me.sqlSelectCommand1.Connection = Me.sqlConnection2

'

'sqlInsertCommand1

'

Me.sqlInsertCommand1.CommandText =
resources.GetString("sqlInsertCommand1.CommandText")

Me.sqlInsertCommand1.Connection = Me.sqlConnection2

Me.sqlInsertCommand1.Parameters.AddRange(New
System.Data.SqlClient.SqlParameter() {New
System.Data.SqlClient.SqlParameter("@nome", System.Data.SqlDbType.VarChar,
0, "nome"), New System.Data.SqlClient.SqlParameter("@cognome",
System.Data.SqlDbType.VarChar, 0, "cognome"), New
System.Data.SqlClient.SqlParameter("@telefono1",
System.Data.SqlDbType.VarChar, 0, "telefono1"), New
System.Data.SqlClient.SqlParameter("@telefono2",
System.Data.SqlDbType.VarChar, 0, "telefono2"), New
System.Data.SqlClient.SqlParameter("@email", System.Data.SqlDbType.VarChar,
0, "email"), New System.Data.SqlClient.SqlParameter("@note",
System.Data.SqlDbType.Text, 0, "note"), New
System.Data.SqlClient.SqlParameter("@datainserimento",
System.Data.SqlDbType.SmallDateTime, 0, "datainserimento")})

'

'sqlUpdateCommand1

'

Me.sqlUpdateCommand1.CommandText =
resources.GetString("sqlUpdateCommand1.CommandText")

Me.sqlUpdateCommand1.Connection = Me.sqlConnection2

Me.sqlUpdateCommand1.Parameters.AddRange(New
System.Data.SqlClient.SqlParameter() {New
System.Data.SqlClient.SqlParameter("@nome", System.Data.SqlDbType.VarChar,
0, "nome"), New System.Data.SqlClient.SqlParameter("@cognome",
System.Data.SqlDbType.VarChar, 0, "cognome"), New
System.Data.SqlClient.SqlParameter("@telefono1",
System.Data.SqlDbType.VarChar, 0, "telefono1"), New
System.Data.SqlClient.SqlParameter("@telefono2",
System.Data.SqlDbType.VarChar, 0, "telefono2"), New
System.Data.SqlClient.SqlParameter("@email", System.Data.SqlDbType.VarChar,
0, "email"), New System.Data.SqlClient.SqlParameter("@note",
System.Data.SqlDbType.Text, 0, "note"), New
System.Data.SqlClient.SqlParameter("@datainserimento",
System.Data.SqlDbType.SmallDateTime, 0, "datainserimento"), New
System.Data.SqlClient.SqlParameter("@Original_id",
System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, False,
CType(0, Byte), CType(0, Byte), "id", System.Data.DataRowVersion.Original,
Nothing), New System.Data.SqlClient.SqlParameter("@id",
System.Data.SqlDbType.Int, 4, "id")})

'

'sqlDeleteCommand1

'

Me.sqlDeleteCommand1.CommandText = "DELETE FROM [anagrafica_web] WHERE
(([id] = @Original_id))"

Me.sqlDeleteCommand1.Connection = Me.sqlConnection2

Me.sqlDeleteCommand1.Parameters.AddRange(New
System.Data.SqlClient.SqlParameter() {New
System.Data.SqlClient.SqlParameter("@Original_id",
System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, False,
CType(0, Byte), CType(0, Byte), "id", System.Data.DataRowVersion.Original,
Nothing)})

'

'sqlDataAdapter1

'

Me.sqlDataAdapter1.DeleteCommand = Me.sqlDeleteCommand1

Me.sqlDataAdapter1.InsertCommand = Me.sqlInsertCommand1

Me.sqlDataAdapter1.SelectCommand = Me.sqlSelectCommand1

Me.sqlDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "anagrafica_web", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("id", "id"), New
System.Data.Common.DataColumnMapping("nome", "nome"), New
System.Data.Common.DataColumnMapping("cognome", "cognome"), New
System.Data.Common.DataColumnMapping("telefono1", "telefono1"), New
System.Data.Common.DataColumnMapping("telefono2", "telefono2"), New
System.Data.Common.DataColumnMapping("email", "email"), New
System.Data.Common.DataColumnMapping("note", "note"), New
System.Data.Common.DataColumnMapping("datainserimento",
"datainserimento")})})

Me.sqlDataAdapter1.UpdateCommand = Me.sqlUpdateCommand1

'

'sqlConnection2

'

Me.sqlConnection2.ConnectionString = "Data Source=m2\sql2k5;Initial
Catalog=planny;Integrated Security=True"

Me.sqlConnection2.FireInfoMessageEventOnUserErrors = False

End Sub

Private WithEvents sqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter

Private WithEvents sqlDeleteCommand1 As System.Data.SqlClient.SqlCommand

Private WithEvents sqlUpdateCommand1 As System.Data.SqlClient.SqlCommand

Private WithEvents sqlInsertCommand1 As System.Data.SqlClient.SqlCommand

Private WithEvents sqlConnection2 As System.Data.SqlClient.SqlConnection

Private WithEvents sqlSelectCommand1 As System.Data.SqlClient.SqlCommand

> Hi Alessandro,
> Sorry for the late reply.
[quoted text clipped - 26 lines]
> Sincerely,
> Wen Yuan
WenYuan Wang - 08 Mar 2007 07:14 GMT
Hi Alessandro,
Thanks for your information.

According to the error message posted in the
http://forums.asp.net/thread/1305510.aspx ( By the way, would you please
post your exact Error message for me?)

"Could not find any resources appropriate for the specified culture or the
neutral culture.  Make sure "SDTR.reconcile_month.resources" was correctly
embedded or linked into assembly "App_Web_gjoeff4z" at compile time, or
that all the satellite assemblies required are loadable and fully signed."

It seem like asp.net 2.0 couldn't read the resource file. Have you embedded
Resource?
Please do the following steps:
1.Select your .resx file.
2.Select "Embedded Resource" in Build Action Properties list box.  

If this method doesn't work for you, could you please provide some
reproduce steps for us if it is possible ?
In fact, I have created a ASP.net 1.1 web project and added a web user
control included SQLDataAdapter, SQLDataConnection ... updated this project
to ASP.net 2.0 using VS 2005 wizard. But I run the project without any
error message.
Additionally, I open the web user control in design mode. But I cannot edit
the SQLDataAdpter on the design mode (There is no SQLDataAdpter on the
design mode). I'm not sure how to achieve this.

(It works fine in 2005, but on some pages, when you edit an SqlCommand for
example, all the SQL strings are moved from the codebehind to a resx file
automatically by VS.NET 2005) in the
http://forums.asp.net/thread/1305510.aspx

Have a great day.
Sincerely,
Wen Yuan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.