Asp.net - Set A Server Side Parameter On An A Entity Data Source?

Oct 6, 2010

I have a gridview which I databind to EntityModel This typically looks like

something a
something b
companyID

on Login I get and set the compnay which has the ID so what in essence I want to do is on databind set the Where clause of data source to what the server side paramter for company ID is. I am sure this is super simple but it is driving me nuts

View 1 Replies


ADVERTISEMENT

Javascript - Format Data (client-side) For (server-side)

Jul 13, 2011

Using the following script:

$("#some_button").click(function() {

var changed = [];

[CODE]...

I need to send back the id, the old value from _1 and the new value from _0 back to the server. What is the best way to format this data so I can easily extract the data from the server side so I can easily email someone for example to let them know which textboxes have changed, what the old values were, and what the new values are

At the serverside level, I am using .NET-3.5 (VB). I know how to send the data bacl. and how to email the data, I just wanted to know how to best format the data at clientside before sending it back. I could have upto 50 sets of id, old, and new values to send back. Sorry for not making that clear earlier.

Example:

How can I modify the script above to generate this?

[
{
"id": "name_0",
"new": "text",

[CODE]...

View 3 Replies

Sql Server - Computer Name Is Needed For "Data Source" Parameter Of Dynamic Connection String

Jun 8, 2012

We are going to change the connection string in Settings.vb so we don't need to worry about what it is when our app runs on a different computer other than the development computer.

[Code]...

View 3 Replies

How To Bind Entity Data Source To Results Of Query

Oct 10, 2010

I have a query that will go away an and find data
Dim HSNs As String = String.Join(",", ListOfHSNs.Cast(Of String)().ToArray())
Dim query As String = "SELECT VALUE O FROM v_BillData AS O WHERE O.HSNumber IN {'" & HSNs & "'}"
Dim hs As New ObjectQuery(Of v_BillData)(query, CType(Session("ObjectCon"), ObjectContext))
What I now wish to do is to use the results of this query to databind to a EntityDataSource?

View 1 Replies

Timers On Server-side - From A Client-side Piece, Call Off To A Server-side Piece

Apr 22, 2011

I'm trying to, from a client-side piece, call off to a server-side piece. I need to do this synchronously. On my server-side code, though, I'm calling off to another piece of code, which I want to have a maximum of, say, 10 seconds to return a value. If I don't have a response within 10 seconds, I want to force my own server piece to set my result equal to 0, and return to the client.

Here's what I have on my server-side code so far:

Public Function GetWebResult(ByVal inputParameter As Object) As WebReturnObject Implements IWebInterface.GetWebResult
Dim result As New WebReturnObject
Dim webItem As WebItem = Nothing

[CODE]...

I realize this code is not functional. The problem is that I'm unsure how I would go about getting back into GetWebResult to set the appropriate return values before it is sent back to the client.

View 1 Replies

Change The Execution Sequence (Client Side Click, Server Side Click) To (Server Side Click - Client Side Click)?

Jun 22, 2011

I am struckup with a problem from last two days. I am creating a web application using VB.NET, Ajax & RAD Controls. When user clicks on a button I want to open a RAD Window and show the list of ledgers available to the user, so that he can select one from the list. And to open that window I have to call a java script function from client side, which is already achieved using the below code.

[Code]...

View 8 Replies

C# - Send An Object From Client-side Javascript To Server-side Code Via ASP.NET?

May 23, 2011

Can I send an object from client-side javascript to server-side code via ASP.NET ?

View 5 Replies

Fire Client Side Code From Server Side At Runtime

Apr 13, 2010

I know this defeats the purpose of client side vs. server side (refer to title of this thread). What I would love to do is build my own custom progress indicator on the client showing how far a server side code has progressed. I figure if I could only get a JavaScript to fire and render a value of some control at pre-defined intervals while the server is working I could make it happen - but alas I'm beginning to believe that this is impossible. Below is some code that performs three 2 sec loops. At the end of each I want to change the visible value of a control on the browser. [Code]

View 8 Replies

Asp.net - Server Side Doesnt See Changes On Client Side?

Jan 25, 2012

I add an option to a select with jQuery. When I save with an asp button, I don't see the changes on the server side in the click event.

And the HTML is all correct after I add the option.

Is it a coding problem or I don't understand something?

$(selectCourant)
.append($("<option></option>")
.attr("value",$(dropdown).val())
.text($(dropdown + " option:selected").text()));

View 1 Replies

Javascript - Register A Client-side Event Listener On A Server-side Event?

Dec 28, 2011

Ultimately, what I want to accomplish is an AJAX-based messaging system. I already have a database table for messages, and an ASPX to add new messages (and declare old messages no longer relevant).

The current messaging system simply polls the server every 15 seconds, and re-pulls the current message set.

What I am looking to do is: On $(document).ready(), register an ajax callback function that listens for a server-side event (e.g., MessagesUpdated) On table insert/update, fire MessagesUpdated server-side.

This way, whenever the table is updated (or new records added), any clients listening know that new data is available and can re-poll the server then.

Ideally, I'd also like to make the new data available as an event argument (to minimize re-polling the db).

I can find references to something like this in other languages, but I cannot find any actual code examples to get me started.

Assuming this is possible to do via .Net, can anyone help get me started on this?

I'm using the 2.0 Framework. Also while I added a VB.Net tag, I can read C# reasonably well, so please feel free to post in either language.

View 4 Replies

Data From Legacy ODBC Source Into SQL Server?

Jul 8, 2009

I have an old VB6 program which copies data from a legacy system (Btrieve 6) into our SQL Server so it can be served up on the web and used to feed some of our other needs. The legacy system outputs a file and a feed program posts it into the legacy ODBC database. The program isn't anywhere near realtime and I am now finding the delay between data going into the legacy database and then into the SQL database is becoming unacceptable so I thought I'd look at VB.NET and see if I could find a better way of doing it using FileSystemWatcher so that when the legacy output file is renamed I can then start a copy of the record affected from the legacy to the new database.

[Code]...

View 1 Replies

Return Object As Parameter For NHibernate Entity?

Nov 2, 2010

I'm writing a solution where the data entities are passed to clients using datasets through a WCF service, with nHibernate as ORM. My predecessor has written some translator classes, converting datasets to entities and vice versa. In most cases he's declared the return object as a parameter for the object.

For example:

Public Shared Function CreateEntity(ByVal ds As DataSetObject, ByVal entity As EntityObject) As EntityObject
Dim row As ds.EntityObjectRow = ds.EntityObject(0)
entity.Id = row.Id

[code]....

He's not with the company anymore, so I can't ask him why he's done it this way. Hence my question here. Is there some performance gain, or traceablity thing with nHibernate by using the first implementation rather than the latter?

View 1 Replies

Asp.net - Entity Framework - Passing Different Object Sets As A Parameter In A Function?

Apr 11, 2012

I have the following code:

Private Sub setDropdowns()
Using licensingModel As New licensingEntities

[code]....

My problem is that i dont know how to define the parameter type for the sub. Because they are different types of objectSets being passed each time, I thought IObjectSet(Of EntityObject) would work, but it gives me the following error:

Unable to cast object of type 'System.Data.Objects.ObjectSet1[licensingModel.tblLookup_Country]' to
type
'System.Data.Objects.IObjectSet1[System.Data.Objects.DataClasses.EntityObject]'‌

View 1 Replies

Connecting Visual Basic To SQL Server Using VB Data Source Configuration Wizard?

Dec 29, 2007

I am a brand new user of MS Visual Basic 2005 Express and MS SQL Server 2005 Express. I have familiarized myself with both programs but have one extremely frustrating problem. Once I open SQL Server, I can not establish a database connection from Visual Basic using the Visual Basic Data Source Configuration Wizard (even if I close SQL Server). If I reboot and open Visual Basic first, I can then connect using the Visual Basic Data Source Configuration Wizard. But then I can not switch to SQL Server and open the database (even if I close Visual Basic). Again, I must reboot to open the database in SQL Server.I suspect there is a setting somewhere that needs to be changed, but I can not find it?

View 6 Replies

VS 2010 - How To Replace Html Entity Code Numbers In Source Results

Sep 6, 2010

how to replace the html code numbers with the correct ones? i would show you example of html output, but vbforum automatically converts the characters so no point. i wish the replace all the & #40; (without the space) and so on with their correct replacement eg, ( in this case. also would like a short way to do this as i will be using this multiple times. so basically i would like the source to be exactly as it would if you viewed source in firefox browser, not with all the special chars unformatted like visual studio does.

View 3 Replies

Change The Connection String (server Ip, User And Password) Of A MySql Data Source In Visual Basic 2010?

Jun 1, 2012

I have a project where I added visually and successfully a datasource of MySql. I binded a datagridview with a table.

But, how do I change programatically the password, ip or user to connect with the MySql server? Because it can change at any time, so I can let the user change these values.

View 7 Replies

Asp.net - Run A Server-side Exe From ASP?

Dec 28, 2009

I have an ASP program that synchronizes 2 databases. I also have a VB.NET program compiled down to an EXE that fills the source database before the synch happens. In the back of my mind I know I should be able to link the VB & ASP .NET programs together since that's the power of .NET. Alternatively, if I could run the EXE from ASP it would be just as well for my project. I do have the source to both programs. The ASP script was written with a text editor - the VB was in VB 2008 Express.

assume I know nothing of linking assemblies and such because I don't - I just read that in an article. I'd prefer ASP but if necessary I could use the ASP.NET script to launch the EXE. The code is legacy ASP with VBScript so all our ASP.NET stuff is the VB flavor as well. C# makes my other programmer's head hurt so for his sake this will have to remain VB.

Is there a way I can relatively easily launch the EXE pre-sync program and have it run when the ASP synch script starts?

The server is MS Windows Server 2003 SP2 / IIS 6.0 / the .NET version is 2.0.50727.3603.

By the way - I'd love to "learn to use .NET properly" but time is short for this project and in-depth research will have to wait.

EDIT: Aaron's answer below gets me most of the way to the solution but I'm getting:

Exception Details: System.ComponentModel.Win32 Exception: Access is denied
Source Error: Line 17: process1.Start();

SOLUTION: Aaron's answer below plus the knowledge that ~/ in MapPath is the virtual root of the website and the file to run is relative to that.

View 2 Replies

IDE :: Data Source Disappeared - Recreate My Data Source From The Entry That Is In App?

Feb 10, 2012

I refreshed my data sources to include additional items from the SQL Server databases and it appears that my entire data source from my VB.NET project disappeared.I am using Entity Framework. I may have clicked on something wrong, not quite sure. Unfortunately I can't recreate the Data Source without creating a new Entity and Data Model.I can delete the entry in the App.Config file and recreated it, however things aren't quite right.Is there a way that I can recreate my Data Source from the entry that is in my App.Config file...since that appears to have remained intact.BTW, I can go to my Data Model and successfully refresh from there, however my project isn't connecting to the database so I have quite a number of errors until I can get reconnected.

View 4 Replies

Run A Server-side Application Via ASP.Net (C# Or VB)

May 20, 2011

I wanted to build a front end web page so that I can start and stop various programs on my server remotely. I know that Shell will open something locally, but how can I make an ASP.Net page which activates programs server-side? Googling got me the "Shell" method, but I don't think that works server-side.

View 1 Replies

Generate A Entity Model From SQL Server?

Feb 6, 2012

I am using MS Visual Basic Express 2010 and trying to generate "ADO.Net Entity Framework" entities from an existing local SQL Server Express database.

Using the "Entity Data Model Wizard" I am asked to configure a connection. Here I prompted to choose a "Data source" and given two options 'Microsoft SQL Server Compact 3.5' and 'Microsoft SQL Server Database File'. I select the second option.

I'm then prompted for connection properties, I have to enter the "Database file name (new or existing)". Here I browse to the SQL server database file of interest (found using Management Studio Express) namely[code]...

View 7 Replies

.net - Server Side Customvalidator (asp + .net) Not Firing?

May 16, 2011

I know this has been asked a lot, but I have a server-side custom validator that is not being fired, and I cannot find why (also, I've copied examples that work from other places and cannot make it work...)

The code:
<asp:CustomValidator ID="MyValidator" runat="server" ErrorMessage="My error message" OnServerValidate="MyValidator_OnServerValidate" />
Validate function

[Code]...

EDIT 2: Added a Page.validate() on my button code, and it does not call the server side of the validator.Also, the custom validator is being called (at least the client/javascript side of it, but not the server side)

View 3 Replies

Asp.net - Injecting Server Side Variables Using <%#

Jul 26, 2010

I was having problems inserting a string into the following tag : <tr id="rowBulkOptions" style='<%# sBulkOptionsRowStyle %>'> Don't ask why I'm using tables sBulkOptionsRowStyle is a Public string in the aspx.vb file. Seemingly the only way I can get this to render is to put Page.DataBind() in the Page_Load, Page_PreRender etc.. However this causes me problems because Page.DataBind() binds all controls on the page. I could use <%= BUT another part of the code inserts controls into the page and apparently you can't use <%= and insert controls.Is there a way I can just say 'look, put sBulkOptionsRowStyle into the page

View 1 Replies

Asp.net Dropdown Always No Selected Value On Server Side?

Feb 3, 2012

I have an asp.net dropdown like this

<asp:DropDownList width="95%" ID="RessourceComposantes" runat="server"
DataSourceID="Composantes"
DataTextField="Description" DataValueField="ComposanteID">
</asp:DropDownList>

[code]....

Is it normal that when I do dd_ressource_composante.selectedvalue on the server side I have no value. It's always "". the source looks like this :

<select name="ctl00$Tab$dd_ressource_composante" id="ctl00_Tab_dd_ressource_composante" style="width:95%;">
<option value="1">Composante</option>
<option value="3">DGAG</option>

[code]....

I just tried to fill my dropdown in vb.net and I have the same result. The dropdown is full but when I do a postback I have no selected value Actually on the server side when I put a breakpoint on the dropdown, the item count is 0. I don't understand why... It's like the 8th dropdown list in this project and everything is the same but this one doesn't work.

I don't do any binding on the page load. it's all in the aspx file well it works ONLY when I add autopostback="true" SelectedIndexChanged="dd_ressource_composante_SelectedIndexChanged" for the dropdown.And theres no code in dd_ressource_composante_SelectedIndexChanged It's vb.net for the server side?

View 5 Replies

Creating A Menu From The Server Side?

Apr 19, 2009

I am creating my menu with javascript. How possible it is that on page load it is created from the server side (VB ASP.NET) rather than the client side? And if this is possible how is this done? My main aim is that I can create menu items from a database.

View 2 Replies

IE Duplicating A Server Side Break

Nov 4, 2010

I have a issue with two breaks < Br /> appearing in IE,If I have a normal break placed like so.[code]Then looking at the source code for IE, it produces two Once which has a ID of brAddAnotherQuote and one which is simple "< br />" directly under it.This doesn't happen in Firefox

View 1 Replies

Load An Image Server-side In ASP.NET?

Apr 9, 2009

I'm trying to load an image that is in the root dir of my project:

Dim b As Bitmap = New Bitmap("img.bmp")

but it doesn't seem to find the file.

I've tried various combinations like ~img.gif, /img.gif, img.gif, ~/img.gif etc, but none seems to work. How to access the "current directory on server" in ASP.NET?

View 1 Replies

Server Side Office Automation?

Jun 22, 2011

We need to perform office automation (opening docx,doc,wrd,wpd files and saving them as .htm files) through Windows service or Web service but Microsoft does not support Microsoft Office automation in server side code.[URL]..We have understood that, "Word automation Services" feature of SharePoint server can be used to achieve this. But we are not in a position to acquire SharePoint server license.

Is there any other way to perform office automation through Windows Service or Web Service?

View 1 Replies

Sql Server - Derived Associations In .Net Entity Framework?

Aug 9, 2010

I want to have a single table that represents a person and have a number of other tables (such as Student/Teacher) use the Person table to store information related to a person. Unfortunately the entity framework doesn't seem to like it when I try to add an association between the Student or Teacher class and I don't understand why. The Person table contains a column called ParentEntityID, which equals either a StudentEntityID or a TeacherEntityID. In an ideal world I would like to be able to reference the Person table by going Student.Person.FirstName instead of Student.Entity.Person1.FirstName. The error .Net returns when trying to connect the Student/Teacher table to the Person table is:

Error 3007: Problem in Mapping Fragments starting at lines 265, 289: Non-Primary-Key column(s) [ParentEntityID] are being mapped in both fragments to different conceptual side properties - data inconsistency is possible because the corresponding conceptual side properties can be independently modified.

The actual database I am working with is a bit more complicated and has a number of tables connected to the Entity table, which makes my object model pretty ambiguous and was hoping to be able to clean it up a bit by using the entity framework.I am using VB.Net 3.5 in a web application.

Update...In an attempt to internalize the different types of relationships I can form, I have been playing with this simple example and have come up with the following possibilities:And the reason why I cannot make an association between the Student and Address table is because that relationship is not enforced in the database. If I wanted an association between these two tables I would need to re-think the design of my database. Is that correct?

View 1 Replies

Call A Server Side Code On Anchor?

Dec 19, 2011

I have the following code to download a file from a FTP server

Sub DownloadFile_Sap()
Dim remoteuri As String = "http://appsrv01.shakarganj.com.pk:7778/reports/rwservlet?reptest&report=sap_dashboard"

[code].....

View 2 Replies

Execute WinForm App Server Side From Program?

Oct 28, 2009

Im trying to execute a winform app from my website (asp .net), this winforms app its execute in the server side for processing information and send email, but i need to pass some arguments, from the webpage i know how to do it, but im asking how to catch the arguments in the winform app?[code]...

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved