I m trying to UPDATE database using FormView and SqlDataSource and here is my code: <asp:SqlDataSource ID="sqlDS1" runat="server" ConnectionString="<%$ ConnectionStrings:myDB %>"UpdateCommand="UPDATE [Consultants] SET [firstName]=@FIRSTNAME,[lastName]=@LASTNAME,[skillCategoryID]=@SKILLCATID,[resourceManagerID]=@RMID,[AMgroupID]=@AMGROUPID,[SkillSet]=@SKILLSET,[statusID]=@STATUSID,[location]=@LOCATION,[comments]=@COMMENTS,[profile]=@PROFILE,[isAvailable]=@ISAVAILABLE,[dateModified]=getdate(),[focusID]=1 WHERE ([id]=@ID)"> <UpdateParameters> <asp:FormParameter FormField="txtFName" Name="FIRSTNAME" /> <asp:FormParameter FormField="txtLName" Name="LASTNAME" /> <asp:FormParameter FormField="ddlSkillCat" Name="SKILLCATID" /> <asp:FormParameter FormField="ddlRM" Name="RMID" /> <asp:FormParameter FormField="ddlAMGroup" Name="AMGROUPID" /> <asp:FormParameter FormField="txtSkillset" Name="SKILLSET" /> <asp:FormParameter FormField="ddlStatus" Name="STATUSID" Type="Int16" /> <asp:FormParameter FormField="txtLocation" Name="LOCATION" /> <asp:FormParameter FormField="txtComments" Name="COMMENTS"/> <asp:FormParameter FormField="txtProfile" Name="PROFILE" /> <asp:FormParameter FormField="cbAvailable" Name="ISAVAILABLE" /> <asp:QueryStringParameter Type="Int32" Name="ID" QueryStringField="id" /> </UpdateParameters>
</asp:SqlDataSource> //******************************************************************* <asp:FormView DefaultMode="Edit" ID="FormView1" runat="server" DataSourceID="sqlDS1" DataKeyNames="id"> <EditItemTemplate> <tr> <td class="blacktextbold"> Resource Manager: </td> <td class="blacktext"> <asp:DropDownList ID="ddlRM" CssClass="blacktext" runat="server" DataSource="<%#GetRM()%>" DataTextField="RMName" DataValueField="userID" SelectedValue="<%#Bind('RMID')%>" AppendDataBoundItems="true"> <asp:ListItem Value="-1">--Select RM--</asp:ListItem> </asp:DropDownList> <asp:CustomValidator ID="cvRM" runat="server" ValidationGroup="gpInsert" ControlToValidate="ddlRM" ClientValidationFunction="validateDropdown" OnServerValidate="servervalidateDropdown" Display="Dynamic" ErrorMessage="Required Field" CssClass="redtextsmallbold" /> </td> </tr> //******************************************************** here is my GetRM() function: protected DataSet GetRM() { string strConnection = ConfigurationManager.ConnectionStrings["myDB"].ToString(); SqlConnection objConnection = new SqlConnection(strConnection); String sqlSkillCats = "SELECT Roles.roleID, Roles.roleName, UsersInRoles.userID, UsersInRoles.roleID AS Expr1, Users.firstName + ' ' + Users.lastName AS RMName, Users.id AS Expr2" + " FROM Users INNER JOIN" + " UsersInRoles ON Users.id = UsersInRoles.userID CROSS JOIN" + " Roles" + " WHERE (Roles.roleName = 'accountmanager') AND (UsersInRoles.roleID = Roles.roleID) ORDER BY Users.firstName"; SqlDataAdapter objAdapter = new SqlDataAdapter(sqlSkillCats, objConnection); objConnection.Open(); //ddlDataSet = new DataSet(); try { objAdapter.Fill(dsConsultantRM, "ConsultantRM"); } catch (Exception ex) { Response.Write(ex.Message); } objConnection.Close(); return dsConsultantRM; }//****************************************************************** i get this error when i load the page:DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'RMID'. basically i m trying to UPDATE database using the value selected in the DropDownList, can anyone tell me whats wrong here...PLZ HELP!
HAI guys,i am suneel.i have a problem..please help me..i am binding my datalist.i have set my dtakey field to the primary key of teh database.i am not displaying the primary key(file_id).but i am displaying the other fields in that table.i have set databinder.Eval(container,dataitem."file_name").i have put one delete button in the item template...if i want to build now...i am getting an error.....DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'file_ID'.wat i have to do..please get me the reply..
Hi,Seems like a lot of people are having a similiar problem that I am having right now, but I am not able to find the solution to it. On the Page_load event, the gridview does display the data from database. When I click a button to insert the same data but different Waste_Profile_Num value, it gives me the databinding error. Component_Profile_ID is declared as an Identity and it is the primary key to the table. Anyway help???Ok, the following are code that I have: 1 <asp:SqlDataSource ID="sqlDSMaterialComposition" runat="server" ConnectionString="<%$ ConnectionStrings:HAZConnectionString %>" 2 SelectCommand="SELECT dbo.Component_Profile.Component_Profile_ID AS Component_Profile_ID, dbo.Component.Component, dbo.Component_Profile.Concentration, dbo.Component_Profile.Range, dbo.Component_Profile.Waste_Profile_Num, dbo.Component.Component_ID FROM dbo.Component INNER JOIN dbo.Component_Profile ON dbo.Component.Component_ID = dbo.Component_Profile.Component_ID WHERE (dbo.Component_Profile.Waste_Profile_Num = @Waste_Profile_Num)"> 3 <SelectParameters> 4 <asp:SessionParameter Name="Waste_Profile_Num" SessionField="Waste_Profile_Num" Type="Int32" /> 5 </SelectParameters> 6 </asp:SqlDataSource> 7 8 9 <asp:GridView ID="GridViewMaterialComposition" 10 runat="server" 11 DataKeyNames="Component_Profile_ID,Component_ID" 12 AutoGenerateColumns="False" ShowFooter="true"> 13 <Columns> 14 <asp:BoundField DataField="Component" HeaderText="Component" SortExpression="Component" FooterText="Total"/> 15 <asp:TemplateField HeaderText="Concentration" FooterStyle-Font-Bold="true"> 16 <ItemTemplate> 17 <%# SumConcentration(decimal.Parse(Eval("Concentration").ToString())).tostring("N2") %> 18 </ItemTemplate> 19 <FooterTemplate> 20 <%# GetConcentration().tostring("N2") %> 21 </FooterTemplate> 22 </asp:TemplateField> 23 <asp:BoundField DataField="Range" HeaderText="Range" SortExpression="Range" /> 24 <asp:BoundField DataField="Component_Profile_ID" HeaderText="Component_Profile_ID" ReadOnly="True" SortExpression="Component_Profile_ID" Visible="true" /> 25 <asp:BoundField DataField="Component_ID" HeaderText="Component_ID" ReadOnly="True" SortExpression="Component_ID" Visible="true"/> 26 <asp:BoundField DataField="Waste_Profile_Num" HeaderText="Waste_Profile_Num" ReadOnly="true" SortExpression="Waste_Profile_Num" Visible="true" /> 27 <asp:CommandField ShowEditButton="true" /> 28 <asp:TemplateField Visible="false"> 29 <ItemTemplate> 30 <asp:Label ID="lblComponentProfileID" runat="Server" Text='<% # Eval("Component_Profile_ID") %>'></asp:Label> 31 <asp:Label ID="lblComponentID" runat="Server" Text='<% # Eval("Component_ID") %>'></asp:Label> 32 </ItemTemplate> 33 </asp:TemplateField> 34 </Columns> 35 </asp:GridView>The following are the code-behind: 1 sqlSelect = "SELECT Range, Concentration, Component_ID FROM Component_Profile WHERE (Component_Profile.Waste_Profile_Num = " & previousWasteProfileNum & ")" 2 sqlDSMaterialComposition.SelectCommand = sqlSelect 3 Try 4 Dim dvComposition As Data.DataView = CType(sqlDSMaterialComposition.Select(DataSourceSelectArguments.Empty), Data.DataView) 5 For Each dr As Data.DataRow In dvComposition.Table.Rows 6 insertSql = "INSERT INTO Component_Profile ([Range], [Concentration], [Component_ID], [Waste_Profile_Num]) " 7 insertSql &= "VALUES (" & dr("Range").ToString.Trim & ", " & dr("Concentration").ToString.Trim & ", " & dr("Component_ID").ToString.Trim & ", " & CInt(Session("Waste_Profile_Num").ToString()) & ")" 8 sqlDSMaterialComposition.InsertCommand = insertSql 9 sqlDSMaterialComposition.Insert() 10 Next 11 Catch ex As Exception 12 13 End Try
my environment: VS2005, SQLExpress with SP1, WXP with SPs, the error msg I get is: 'System.Data.DataRowView' does not contain a property with the name 'change'. The base for all this is the 'MS Club Site' sample code downloaded from ASP.NET! After adding a new data field "change" to my DB I changed the StoredProcedure "PagedUpcommingEventList" (statement 31) and in the 'Repeater' I added statement 32 to reflect this change (see code below). When calling 'Configure Data Source' on the SQLDataSource I can read the DB (using the StoredProcedure) but I never see the new field 'change'! I certainly checked for additional StoredProcedures with the same name: "PagedUpcommingEventList" --- I definitely have only one in my project.PS: In another .aspx file using a SQLDataSource with a DataGrid; the field is showing up correctly! I spent days in the area of 'caching' without any success; thought the StoredProcedure is always called from the 'cache'! .... Thank you for your time .... any idea is appreciated! ed 1 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>" 2 SelectCommand="PagedUpcommingEventList" SelectCommandType="StoredProcedure" OnSelected="SqlDataSource1_Selected" CacheDuration="1"> 3 <SelectParameters> 4 <asp:Parameter Name="pageCount" Direction="ReturnValue" Type="Int32" /> 5 <asp:ControlParameter Name="pageNum" ControlID="pn1" PropertyName="SelectedPage" /> 6 <asp:Parameter DefaultValue="5" Name="pageSize" Type="Int32" /> 7 </SelectParameters> 8 </asp:SqlDataSource> 1 <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"> 2 <ItemTemplate> 3 <div class="listitem"> 4 <%-- class="thumbnail"> 5 <a href='<%# "Events_view.aspx?Eventid=" &Cstr( Eval("ID"))%>'> 6 <Club:ImageThumbnail ID="ImageThumbnail1" runat="server" PhotoID='<%# Eval("photo") %>' 7 NoPhotoImg="images/calendar.jpg" /> 8 </a> 9 </div>--%> 10 <asp:panel ID=panel2 runat=server cssclass="editbuttons" Visible='<%#Isadmin %>'> 11 <Club:RolloverLink ID="EditBtn" runat="server" Text="Edit" NavigateURL='<%# "Events_Edit.aspx?Action=Edit&id=" & cstr(Eval("id")) %>' /> 12 <Club:RolloverLink ID="RemoveBtn" runat="server" Text="Remove" NavigateURL='<%# "Events_Edit.aspx?Action=Remove&id=" & cstr(Eval("id")) %>' /> 13 </asp:panel> 14 <%--> 15 <asp:Label ID="itemdateLabel" runat="server" Text='<%# Eval("starttime","{0:d}") %>' /> 16 <a href='<%# "Events_view.aspx?Eventid=" &Cstr( Eval("ID"))%>'> 17 <asp:Label ID="titleLabel" runat="server" Text='<%# Eval("title") %>' /> 18 </a> 19 </h3> 20 <p> 21 <asp:Label ID="descriptionLabel" runat="server" Text='<%# truncate(CStr(Eval("description"))) %>' /> 22 <a href='<%# "Events_view.aspx?Eventid=" &Cstr( Eval("ID"))%>'>read more »</a></p> 23 <div class="clearlist"> 24 </div>--%> 25 <h3> 26 <asp:Label ID="Label1" runat="server" Text='<%# Eval("starttime","{0:d}") %>' /> 27 <a href='<%# "Events_view.aspx?Eventid=" &Cstr( Eval("ID"))%>'> 28 <asp:Label ID="Label2" runat="server" Text='<%# Eval("title") %>' /> 29 </a> 30 </h3> 31 <asp:Label ID="Label3" runat="server" Text='<%# truncate(CStr(Eval("description"))) %>' /> 32 <asp:Label ID="changeLabel" runat="server" Text='<%# Eval("change") %>' style="position:relative ; LEFT:300px" Font-Names="Arial" Font-Size="Medium"/> 33 <div class="clearlist"></div> 34 <p></p> 35 </div> 36 </ItemTemplate> 37 </asp:Repeater> 1 CREATE PROCEDURE PagedUpcommingEventList 2 ( 3 @pageNum int = 1, 4 @pageSize int = 10 5 ) 6 7 AS 8 declare @rows int 9 declare @keydate datetime 10 declare @keyid int 11 declare @rowCount float /* yes we need a float for the math */ 12 13 if @pageNum = 1 14 begin 15 set @keydate= GETDATE() 16 set @keyid=0 17 end 18 else 19 BEGIN 20 /* get the values for the date and row */ 21 select @rows = (@pageNum-1) * @pageSize 22 SET ROWCOUNT @rows 23 select @keydate=starttime, @keyid=id from Events 24 WHERE Events.starttime > GetDATE() 25 ORDER BY starttime asc, id asc 26 END 27 28 select @rowCount=count(*) from Events WHERE Events.starttime > GetDATE() 29 30 SET ROWCOUNT @pageSize 31 SELECT Events.id, Events.starttime, Events.title, Events.description, Events.photo, Events.change, 32 Locations.title AS locationname 33 FROM Events LEFT OUTER JOIN Locations ON Events.location = Locations.id 34 WHERE (Events.starttime > @keydate OR 35 (Events.starttime = @keydate) AND (events.id > @keyid)) 36 ORDER BY Events.starttime asc, Events.id asc 37 RETURN CEILING(@rowCount/@pageSize) 38 GO
myCODE ; public void FullnameOfOwner() { GATEWAY.DSMESAJTableAdapters.MESAJMERKEZI_GELEN_MESAJLAR_EMLAKCIADITableAdapter adapEmlakciAdi = new GATEWAY.DSMESAJTableAdapters.MESAJMERKEZI_GELEN_MESAJLAR_EMLAKCIADITableAdapter();GATEWAY.DSMESAJ.MESAJMERKEZI_GELEN_MESAJLAR_EMLAKCIADIDataTable dtGelenMesajlar = new GATEWAY.DSMESAJ.MESAJMERKEZI_GELEN_MESAJLAR_EMLAKCIADIDataTable(); adapEmlakciAdi.Fill(dtGelenMesajlar, OwnerID); grdGelen.DataSource = dtGelenMesajlar; grdGelen.DataBind(); } public void MessagesfromOWNER() {GATEWAY.DSMESAJTableAdapters.MESAJMERKEZI_GELEN_MESAJLARTableAdapter adapGelenMesajlar = new GATEWAY.DSMESAJTableAdapters.MESAJMERKEZI_GELEN_MESAJLARTableAdapter();GATEWAY.DSMESAJ.MESAJMERKEZI_GELEN_MESAJLARDataTable dtGelenMesajlar = new GATEWAY.DSMESAJ.MESAJMERKEZI_GELEN_MESAJLARDataTable();adapGelenMesajlar.Fill(dtGelenMesajlar, (int)OwnerID,(int)UserID,"EMLAKÇI"); grdGelen.DataSource = dtGelenMesajlar; grdGelen.DataBind(); } protected void grdGelen_PreRender(object sender, EventArgs e) { MessagesfromOWNER(); FullnameOfOwner(); } MyDatabaseQuery SELECT _NAME, FROMID, TOID, _DESCRIPTION, _CATEGORY, _OWNERID, _LASTMODIFYDATE, _ID, FROMTYPEFROM MESSAGEWHERE (TOID = @TOID) AND (FROMID = @FROMID) AND (FROMTYPE = @EMLAKCI) for Message SELECT FIRSTNAME + ' ' + LASTNAME AS FULLNAME, USERIDFROM [USER]WHERE (USERID = @USERID) for fullname so i have there columns so i write grdGelen columns[0] >_NAME , columns[1] > LASTMODIFYDATE Columns[2] > FULLNAME AND DATAKEYNAMES TOID,FROMID,FROMTYPE is of MY GRİDVİEW i have a problem on dataset. i create two tableadapters and datatables because i must take from different datase fullname so it is showing this mistake "'System.Data.DataRowView' does not contain a property with the name 'TOID'." what can i do ?
I have created a windows library control that accesses a local sql database
I tried the following strings for connecting
Dim connectionString As String = "Data Source=localhostSQLEXPRESS;Initial Catalog=TimeSheet;Trusted_Connection = true"
Dim connectionString As String = "Data Source=localhostSQLEXPRESS;Initial Catalog=TimeSheet;Integrated Security=SSPI"
I am not running the webpage in a virtual directory but in
C:Inetpubwwwrootusercontrol
and I have a simple index.html that tries to read from an sql db but throws
the error
System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.PermissionSet.Demand() at System.Data.Common.DbConnectionOptions.DemandPermission() at System.Data.SqlClient.SqlConnection.PermissionDemand() at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,
etc etc
The action that failed was: Demand The type of the first permission that failed was: System.Data.SqlClient.SqlClientPermission The Zone of the assembly that failed was: Trusted
I looked into the .net config utility but it says unrestricted and I tried adding it to the trusted internet zones in ie options security
I think that a windows form connecting to a sql database running in a webpage should be simple
I have written a CLR Function in C#. The function works as expected except that I am trying to read data some data during the function call and get the following error:
Msg 6522, Level 16, State 1, Line 1
A .NET Framework error occurred during execution of user-defined routine or aggregate "fn_SLARemaining":
System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.
System.InvalidOperationException:
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
conn.Open(); . Everything works fine when I run it from my computer. When I try to run it from a network share I get the following error,
Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I am using Visual Studio 2005 and .Net framwork v2.0.50727.
I have a report that uses some embedded custom code. The embedded custom code is a function that execute some sql query on a sql server database.Everything works fine in Visual studio. The report gets deployed on the server successfully, however when running the report from report manager i get the following error message :
The Hidden expression for the table €˜table1€™ contains an error: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Public function get_field() as string Dim myConnection As System.Data.SqlClient.SqlConnection Dim myCommand As System.Data.SqlClient.SqlCommand Dim data_reader As System.Data.SqlClient.SqlDataReader Dim field(100) as string Dim i as integer Dim j as integer Dim sql_field as string Dim nbr_field as integer Dim rtn_string as string
i = 0 sql_field ="Select field from mytable" myConnection = New System.Data.SqlClient.SqlConnection("Datasource=xxx.xxx.xxx.xxmydatabase;Initial Catalog=mydatabase;User Id=user1;Password=password1;") myConnection.Open() myCommand = New System.Data.SqlClient.SqlCommand(sql_field, myConnection) data_reader = myCommand.ExecuteReader() While data_reader.Read() if data_reader.HasRows then field(i)= data_reader(0).ToString() end if nbr_field = nbr_field + 1 i= i+1 End While data_reader.Close() myConnection.Close()
for j = 0 to nbr_field -1 rtn_string = rtn_string + field(j) + "," Next j
rtn_string = left(rtn_string,rtn_string.length-1) return rtn_string 'return sql_cmd 'return yes_no 'return lkupfield end function
Hi, I've written this code multiple times now. But for the first time i get an error at the line underlined. My procedure runs perfectly when i execute it through Sql Query analyzer. plzz help.. Its urgent and am unable to find the reason for this error "A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll" Thanks !SqlConnection conn = new SqlConnection(DbConnectionString); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "dbo.rqryTradesPRR"; cmd.Parameters.Add("@COBDate",SqlDbType.DateTime).Value = "2002-10-31 00:00:00.000" ; SqlDataReader reader = cmd.ExecuteReader(); while(reader.Read()) { // have written something here
I am trying to make a mobile application work, but I get the following error. The operating system on Pocket PC is Microsoft® Windows Mobile„¢ 2003 Second Edition. Any ideas? Thanks in advance.
The followings are the error and my codes:
System.TypeLoadException was unhandled Message="Could not load type 'System.Data.SqlServerCe.SqlCeDataAdapter' from assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91'." StackTrace: at SQLMobile.Form1.Form1_Load() at System.Windows.Forms.Form.OnLoad() at System.Windows.Forms.Form._SetVisibleNotify() at System.Windows.Forms.Control.set_Visible() at System.Windows.Forms.Application.Run() at SQLMobile.Form1.Main()
Codes:
Private Sub FillGrid()
Dim filename As New String _
("Program FilesSQLMobilesqlmobile.sdf")
Dim conn As New SqlCeConnection("Data Source=" + filename)
Dim selectCmd As SqlCeCommand = conn.CreateCommand()
selectCmd.CommandText = "select Destination from flightdata"
I am having problems exporting data into a flat file using specific code page. My application has a variable "User::CodePage" that stores code page value (936, 950, 1252, etc) based on the data source. This variable is assigned to the CodePage property of desitnation file connection using Property expression.
But, when I execute the package, the CodePage property of the Destination file connection defaults to the initial value that was set for "User:CodePage" variable in design mode. I checked the value within the variable during runtime and it changes correctly for each data source. But, the property of the destinatin file connection doesn't change and results in an error.
[Flat File Destination [473]] Error: Data conversion failed. The data conversion for column "Column01" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
[DTS.Pipeline] Error: The ProcessInput method on component "Flat File Destination" (473) failed with error code 0xC02020A0. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.
If I manually update the variable with correct code page and re-run the ETL, everything works fine. Just that it doesn't work during run-time mode.
I developed a simple custom control flow component which has several read/write properties and one readonly property (lets call it ROP) whichs Get method simple returns the value of a private variable (VAR as string). In the Execute method the VAR has a value assigened. When I put the value of ROP or VAR into MsgBox I can see the correct value. However when I execute the component I can not see the value of the ROP in the property window. I see the property but its value is empty string. For example when I put a breakpoint to postexecute or check the property before click OK in a MsgBox I would expect that the property value would be updated in SSIS as well. Is there a way how to display correct values of custom tasks properties in property window?
Untill recently I had a smooth running SSIS package,but suddenly it throws error syaing "OnError,,,,,,,The result of the expression
"@[User:trTextFileImpDirectory] +"SomeTextStringHere"+ @[User:trANTTextFileName] +(DT_STR,30,1252) @[User:taging_Date_Key]+ "SomeTextStringHere" " on property "ConnectionString" cannot be written to the property. The expression was evaluated, but cannot be set on the property."
I have child SSIS package running under a parent package (through execute package task)
I have few flat file connection managers in child package for text file import , in which I am building text file path dynamically at run time by assigning an expression in connection string property of connection manager. The Expression is as follows
Where @[User:trTextFileImpDirectory] is a variable which contains path of directory containg text files.Value in this variable is assigned at runtime from parent package's variable,which in turns fetch value from a configuration file on local server.
With my current configuration this path has been configured to some other server's directory over network ( I.e my package picks text files from some other servers folder over network)
While "Some string here"+ @[User:trANTTextFileName]" part of file name string.
(DT_STR,30,1252) @[User:taging_Date_Key] Contain the date of processing ,value in this variable is also picked up at run time from parent package variable.
1) So can someone give me some insight into possible reason of failures. 2) Is it possible that problem arises if directory (from which I m picking text files) is assigned password or is there exist some problem in accessing forlders over network ? 3) Or there can be some problem in package configuration at design time( I.e where I m assigning value in variable from parent package vriables)?
hello... Probably a simple question but I have to ask...using visual basic 2005 express...
I have two tables one with last name and basic info, one with detailed info. Both set up with Primary key and Foreign key.
I have a combo box that displays the last names and then by clicking the last name, text boxes fill with the "other" data from table1, however, there are some text boxes that I would like to fill with data from the table2. Any pointers??
I’m trying to teach myself C# and trying to create a simple (so I thought) little database using Infragistic's UltraWebGrid (Althought my question is more ASPish). Every sample I run across seems to only show the very basics and doesn’t seem to go into anything more than just a simple table and displaying it in a Gird. Which is pretty easy and I can do that all day and night. Anyway, my database has three tables in a one-to-many relationship. The database is of Trucking companies and which states they service and they can service multiple states. The database is like this: Compnies: TruckerID, Company Name, Address, etc. ServiceStates: TruckerID, StateID StateNames: StateID, StateName, StateAbbreviation I would like to show the States that they service in a Hierarchical Grid. I can write the SQL to do what I want to, basically do an inner join on ServicesStates and StateNames based on the TruckerID. I can sit all day and night getting what I would like to display in the WebGrid in the query builder on the SQL server. I figured it wouldn’t be much of a stretch to be able to do that in UltraWebGrid (Or whatever floats your boat). Anyway, on to my question. :) While browsing the samples on everything, I've figured out, that I will need to use the SqlDataAdapter Class, to access the database. Then I'll need to use the SQLConnection Class, and populate a DataSet. Now while in VS I can go to WebSite -> Add New Item -> DataSet slap my tables on there and away I go (at least it seems that way). If I do that, what exactly is the difference between doing that and using the dataset class? When I do that, is that not creating the dataset? I see all the classes it created (I named mine Trucking). I see all the SQL statements in the classes. I imagine I must be missing something *REALLY* simple or this just went way over my head at by at least 40,000 ft. Thanks, marly
Hai,i'm new asp.net and vb.net i have few textboxes and few dropdownlists.i want to insert data in (.mdf )database with these textboxes and dropdown lists please anybody can tell me a sample and simple example.
I am trying to put the data from a field in my database into a row in a table using the SQLDataSource.Select statement. I am using the following code: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'" myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String)But when I run the code, I get the following error:Server Error in '/YorZap' Application. Unable to cast object of type 'System.Data.DataView' to type 'System.String'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.Source Error: Line 54: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'" Line 55: 'myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments).GetEnumerator.Current, String) Line 56: myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String) Line 57: Line 58: filesTable.Rows.Add(myDataRow)Source File: D:YorZapdir_list_sort.aspx Line: 56 Stack Trace: [InvalidCastException: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.] ASP.dir_list_sort_aspx.BindFileDataToGrid(String strSortField) in D:YorZapdir_list_sort.aspx:56 ASP.dir_list_sort_aspx.Page_Load(Object sender, EventArgs e) in D:YorZapdir_list_sort.aspx:7 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45 System.Web.UI.Control.OnLoad(EventArgs e) +80 System.Web.UI.Control.LoadRecursive() +49 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3743 Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210 Please help me!
Hi, I have a page created within VS 2005 which uses a detailsView with a SQLDataSource which has insert, edit and delete items allowed with it. The problem is that if I delete a record I dont want to refresh the page as I want to set a label value to say item deleted. The problem then though is to select the item to delete I have a drop down which populates the details view on index change, but if I delete the item I cannot do a databind when its complete because it just binds to the existing dataset and does not do a fresh call on the database.Is there a command I can run to refresh the dataset on click of the delete button?Thanks
Hi,i have a question, i have a VS2005 and a SQL server 2000 enterprise in my office that i used for web developement,iam new to this, i made a data driven site using some automated controls available in the toolbox, but i need to made some manual process, like i need to make a LABEL show the SUM of specific number fields from my data base, they say i have to make a OLEDB connection using VB, but i don't know how,can you tell me how?Thanks
I am stuck with a SSIS package and I can€™t work out. Let me know what steps are the correct in order to solve this. At first I have just a Flat File Source and then Script Component, nothing else.
Error:
[Script Component [516]] Error: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.SqlClient.SqlConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)
Script Code (from Script Component):
' Microsoft SQL Server Integration Services user script component ' This is your new script component in Microsoft Visual Basic .NET ' ScriptMain is the entrypoint class for script components
Imports System Imports System.Data.SqlClient Imports System.Math Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Public Class ScriptMain Inherits UserComponent
Dim nDTS As IDTSConnectionManager90 Dim sqlConnecta As SqlConnection Dim sqlComm As SqlCommand Dim sqlParam As SqlParameter
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim valorColumna As String Dim valorColumna10 As Double
valorColumna = Row.Column9.Substring(1, 1)
If valorColumna = "N" Then valorColumna10 = -1 * CDbl(Row.Column10 / 100) Else valorColumna10 = CDbl(Row.Column10 / 100) End If
Executed SQL statement: SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = @PARAM1)
Error Source: SQL Server Compact Edition ADO.NET Data Provider
Error Message: @PARAM1 : Unable to cast object of type 'System.Data.SqlTypes.SqlInt32 to type System.IConvertable'. ****************************************
The same querypreview works fine without the parameter:
SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = 186)
Can anybody tell me why this is? And tell me a way to get the tableadapter working?
Hey all, I had a few questions about how to properly use the sqldatasource - I have a form with a single dropdownlist, databound to an sqldatasource that just has a select statement. Over the course of time, the client has requested additional dropdownlists, all of which point to different sqldatasources. After I reached 4 or 5, I noticed the page started to load incredibly slower. I played around with the caching features, and after a good while of reading up on it, finally was able to cache the page /data and notice an increase. Later, another 4 dropdownlists were added, 3 of which all take the same data. I assumed if I had 3 dropdownlists, which need the same data, I should use the same sqldatasource. What do you think? My page is behaving unaccepteably slow again. As a test, I created a new page, and bound it in the same fashion. I slowly added more dropdownlists /sqldatasources, and found it lags a bit on the initial load time (maybe 10-12 seconds of processing time before the page loads). The tables it is pulling data from do not have a primary key, and i'm doing select statements that return roughly 100-200 rows of data (per dropdownlist on average). I'm only selecting 1 column name (no select * here) I'm just curious if anyone has experienced similar issues, and also if there is anything I should do as a best practice while working with the sqldatasource. I've used hundreds of these on forms, and never experienced a problem. I only started noticing this on pages that have multiple. Also, when using multiple dropdowns that need the same data (I know that sounds goofy - why have 3 dropdownlists with the same data) should I use 3 individual datasources? Thanks for your help in advance, Mike
We are tired of null values coming out of from the database and we are directly coding behind UI decleratively. We set up a null value coding standarts but I wonder what are the disadvantages to our approach DataType The default value we send ALLOW NULL int,bit,decimal 0 NOnvarchar(string) " "(one space) NOdatetime YESbinary YES *in datetime we do not allow nulls in places such as _CREATEDATE and _LASTMODIFYDATE fields. What are other approaches for null besides writing your own layer to handle it ?
Hello, I would like to databind a textbox (the Text property) and I have try the following syntax: Text='<%# Bind("au_fname") %>' but there's no Datasource property for this control. I have defined a SqlDatasource object but can I link it to my Textbox. I have looked at the properties of the control: there's a Expressions section in which I can configure a connection string but thar's all. When I run the page I have no error but the textbox field is empty. Thanks for your help.
Does anybody know a good way to get a (near) live view of a sqlce database that doesn't involve ResultSets? I tried to use a resultset with the Sensitive option set, but it doesn't like the joins that I have to do in order to have the data make sense to the user.
If I add a new row and try to move there using the code below, nothing happens (neither movement to a new position nor error message), unless I remove the radio button bindings. (The same thing occurs if I attempt to move to any record that has a null value in the database field for a radio button).
myLastRow = dsData.Tables["Results"].NewRow();
dsData.Tables["Results"].Rows.Add(myLastRow);
I attempt to move by changing the value of the position property of the BindingContext object.
How can I retain the radio button bindings and still be able to add and move to a new row?
Currently, I have a WinCE application which uses the System.Data from NetCF and System.Data.SqlserverCE from MSSQL Server 2005 Mobile Edition. Now, I'm trying to use the System.Data.Sqlclient but I can't seem to find it in my System.Data. I notice that there are different version which is one from NetCF and one from the MS.Net framework itself.
Here's my question: Is it possible for me to use both System.Data? or should I only choose one. This is for my attempt to connect also from an SQLServer and connect to the local SQLServerCE as well.