Help Assigning A Datasource To The Gmap Control In C#
Sep 18, 2007
I'm trying to assign a datasource to a gmap control in 2.0 so that i can get pushpins in the map for all the locations in the sql db. I've enclosed my code below as well as a link to the site that provides the control and their sample. Can anyone tell me why it won't show the pins? What am I doing wrong?
Thanks.
My Code (sqllocations is a datasource):
GMap1.DataSource = sqllocations;
GMap1.DataBind();
Their site: http://en.googlemaps.subgurim.net/ejemplos/ejemplo_991000_DataSource.aspx
Their example (part of their explanation is not english, sorry):
List<DataSourceField> fields = new List<DataSourceField>();
fields.Add(new DataSourceField(45, 2, "hola"));
fields.Add(new DataSourceField(46, 3));
// Lo comentamos porque al utilizar la clase DataSourceField,
// pero si fuera un dataset o cualquier otra cosa,
// le deberíamos dar los nombres correspondientes
// GMap1.DataLatField = "lat";
// GMap1.DataLngField = "lng";
// GMap1.DataGInfoWindowTextField = "gInfoWindowText";
GMap1.DataSource = fields;
GMap1.DataBind();
View 1 Replies
ADVERTISEMENT
Jan 2, 2008
Dear All:
I am new to SSRS 2005.
I have created many shared datsources and reprots at http://localhost/resportserver.
I am trying to access these reports from ReportViewer in the web application. Actually I want to use these reports for different customers by just changing the datsource programitically.
Is this is a possible?
Thank you
Theju
View 2 Replies
View Related
Jan 11, 2008
Hi, I have an app where I am calling a stored procedure that runs and returns an integer. I would like to assign this integer to a control on the page. Here is a sample of code and below I will give the errors: Protected Sub NewButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NewButton.Click Dim tempconnection As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("TestConnectionString").ConnectionString) Dim tempproc As New Data.SqlClient.SqlCommand("SP_FetchProviders", tempconnection) Dim tempparam As New Data.SqlClient.SqlParameter tempproc.CommandType = Data.CommandType.StoredProcedure tempproc.Parameters.Add(New SqlParameter("@Agency_ID", Data.SqlDbType.Int)) tempproc.Parameters("@Agency_ID").Value = "8" 'Using a number just to test, will be populated by a session variable later tempparam = tempproc.CreateParameter() tempparam.ParameterName = "@OutValue" tempparam.Direction = Data.ParameterDirection.ReturnValue tempparam.SqlDbType = Data.SqlDbType.Int tempconnection.Open() tempproc.ExecuteNonQuery() Dim labelfill As String labelfill = tempproc.Parameters("@OutValue").Value tempconnection.Close() CType(Me.DetailsView1.FindControl("OmbudINSDDL"), DropDownList).Items.Add(labelfill) 'This is inside of a detailsview templatefield End Sub Here is the stored procedure set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgoALTER procedure [dbo].[SP_FetchProviders] @Agency_ID intas Select Name, ProviderSubUnit_ID From ProviderSubunit a join Ombudsman b on a.contractproviders_id=b.contractproviders_id Where b.agency_id = @Agency_ID Order by Name This takes the @Agency_ID as input variable, and has returns an integer (according to SQL management studio). When I try to run my code I get the error that an sqlparameter with parametername @OutValue is not contained by this sqlparametercollection. This may be a simple question, but does the outvalue have to be declared in the stored procedure? If so, can you provide the right syntax? If not, can you offer a suggestion to populate the dropdownlist with the returned value? Thanks in advance.
View 3 Replies
View Related
Dec 21, 2006
Hi,
I need to assign the value for a field in a report based on Expand/Collapse state of another field.
Eg. If Collapsed, the value should be "AA" else if Expanded "BB".
Is there any way to get the value of InitialToggleState for any field in SSRS.
Thanks in advance.
Sathya
View 1 Replies
View Related
May 21, 2006
When I put a sqldatasource in my page and want to configure it and add a new connection to it I recieve this error : "object reference not set to an instance of an object" . Do you have any idea about solving this problem. please help me Thanks
View 5 Replies
View Related
Oct 1, 2007
Hello,
I encountered an interesting situation. I have a gridview and a sqldatasource. It has delete function. When I delete a record an error of foreign key violation is raised. I would like to trap this error and give a user friendly message to the user.
If I use ADO.Net I can use Try/Catch, but it seems there is no way to do the same thing using datasource. Anyone knows?
Thank you,
J
View 6 Replies
View Related
Nov 19, 2007
Hi all,
Can anyone tell me how I can do a "Dirty Read" on a SqlDataSource Control? I'm affraid that the record locks are causing problems on the live system.
It is connected to an infromix db using odbc. Thanks.
View 1 Replies
View Related
Jan 18, 2008
Hey all,
I was wondering what the best method of checking on page_load if a datasource control is pulling back nothing from a database. I want to display a message explaining that there is no data to be displayed. How would I go about doing that? I have tried searching google and whatnot but didn't find anything really helpful.
Here is the current code for the data source control.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|EventInsider.mdf;Integrated Security=True;User Instance=True"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT Events_Groups.GroupName, Events_Groups.GroupID FROM Events_GroupMembership INNER JOIN Events_Groups ON Events_GroupMembership.GroupID = Events_Groups.GroupID WHERE (Events_GroupMembership.UserID = @UserID)">
<SelectParameters>
<asp:SessionParameter Name="UserID" SessionField="UserID" />
</SelectParameters>
</asp:SqlDataSource>
But I have no idea what the code behind would be to check it on page_load. If there is no way to particularly do this, do you have to do it per control? Like dropdownbox's or gridviews? I am just confused on how to check to make sure there is data to be displayed.
Thanks,
Chris
View 3 Replies
View Related
Mar 24, 2008
does anybody know where I can learn how to add, update, delete using SQL datasource control? I have a couple of books that shows me how to SELECT but nothing shows me how to update, add new record or delete with the SQL data source control. Even this website doesn't have any tutorial. Does any body know where I can read up on how to use all features of this control? Or where that have a couple of examples on how to use it?
View 5 Replies
View Related
Apr 11, 2006
Hi I am trying to open a database connection to a Northwind database. I can open it with a datasource control and return data to a gridview, but can't programically. I get a sqlexception error. this is ust for learning.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim S As New SqlConnection Dim builder As New SqlConnectionStringBuilder builder("Data Source") = ".SQLEXPRESS;AttachDbFilename=C:SQLNORTHWND.MDF" builder("Integrated Security") = True builder("Connect Timeout") = 30 builder("User Instance") = True S.ConnectionString = builder.ConnectionString Me.Label1.Text = S.ConnectionString S.Open() Me.Label2.Text = S.State.ToString S.Close() Me.Label3.Text = Me.SqlDataSource1.ConnectionString.ToString End Sub
The text in label2 and Label three are identical except there are "" around the datasource.
How come I can connect through the datasource control but not through code?
View 6 Replies
View Related
Mar 23, 2008
I can select the tables and fields, but when I click on Advanced the Check Box to Create the Commands is not available. they are dimmed out.
Why is this happening, is it a setting that I have missed. Any help is appreciated.
View 1 Replies
View Related
Jan 27, 2008
Hi All,
I am placing a Matrix inside the table control for grouping requirements,but when we export the report to the Excel, the contents inside the table cell are ignored. Is there any way to get the full report exported, as per the Requirement.Please help me with this issue.
With Thanks
M.Mahendra
View 5 Replies
View Related
Oct 25, 2007
does any one have and example of how to embedd a flash swf file onto a report.??? Is it possable? any examples would be helpful.
View 1 Replies
View Related
Mar 20, 2007
UPDATE #2: When it said "Do you want to install Microsoft SQL Server" I said "yes" and that caused it to work. I exited and re-ran and now the print runs w/o the "install SQL Server" (If the prompt had said "Do you want to install the print dialog" we wouldn't be having this discussion...)
UPDATE: After posting this i discovered that the same thing occurs when attempting to print the report direct from IE6: First a dialog pops up "Do you want to install this software?" Name: Microsoft SQL Server. When I click "Don't Install" I get the dialog "unable to load client print control." Since this happens direct from IE6 I suspect it's browser settings. I'll resume tomorrow and post a followup.
My WinForm C# app integrates Reporting Services by calling them from WebBrowser controls. The problem is attempts to print cause a dialog: "unable to load client print control."
I've read prior posts that say "enable Active-X in your browser" - I don't know how to do that from a WebBrowser control.
Any ideas how to support Reporting Services "Print" from within a WebBrowser control?
RELATED THREADS
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=332145&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=264478&SiteID=1
View 1 Replies
View Related
Feb 19, 2004
Hi,
I have three tables -
Table A
Col1...Col2
1.....A
2....B
Table B
Col3...Col4
1.....X
2....Y
TableC
Col1...Col3....Col5...Coln
1........1...........H....Y.
A&B serve as the parent table for C. A&B are the dimension tables and C is the fact table. How do I assign the PK and FK in EM?
Thanks
View 5 Replies
View Related
Mar 8, 2005
Consider the following:
Sub regUser(s as Object, e as EventArgs)
If IsValid Then
Dim stuTable as String
Dim connStr as String
stuTable = "mytable"
connStr = "myConnectionInfo"
'check to see that student num is in the db
Dim connect as SqlConnection
Dim strSelect as String
Dim cmdSelect as SqlCommand
Dim strDbResult as SqlDataReader
connect = New SqlConnection(connStr)
strSelect = "SELECT stu_num, stu_fname, stu_lname FROM " + stuTable + " WHERE stu_num=@stuNum"
cmdSelect = New SqlCommand(strSelect,connect)
cmdSelect.Parameters.Add("@stuNum", txtStdNum.text)
connect.Open()
strDbResult = cmdSelect.ExecuteReader()
Dim stuFName as String
Dim stuLName as String
Dim stuEmail as String
Dim strRandom as String
Dim strPassword as String
Dim i as Integer
Dim charIndex as String
Dim stuMailMessage as MailMessage
Dim strHTMLBody as String
'declare stuFname, stuLname, stuEmail
stuFName = strDbResult("stu_fname")
stuLName = strDbResult("stu_lname")
stuEmail = txtStdEmail.text
'more code follows ....
In my DB I have a table with the columns stu_num, stu_fname and stu_lname. Each of these columns contains rows with data. However, the proceeding code gives me this error: Invalid attempt to read when no data is present (line 58 --> stuFName = strDbResult("stu_fname") ).
What am I doing wrong here? How do I assign the stu_fname in the DB to the page level variable stuFName?
As a little aside how do I say "If no record was found matching stuNum Then" ... ??
Sorry, I'm a .NET beginner ...
View 1 Replies
View Related
Feb 4, 2008
Hi,
Is it possible to assign the column value to a user defined variable?
View 3 Replies
View Related
Aug 24, 2007
Hi ,
I have a typical scenario here where I am trying to assign a variable a value using another variable, for that I am using two execute SQL task , the fisrt one assigns the first variable a value and then the second one uses the first variable to evaluate and then assigns a value to another variable. The first execute sql task works fine , however the second one fails with the following error
"failed with the following error: "An error occurred while extracting the result into a variable of type (DBTYPE_I4)". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. "
Here is the query I am using to assign the value in my second execute sql task
select (CASE
WHEN Sum(col1) <> 0 AND ? = 'M' THEN 'M'
WHEN Sum(col2) <> 0 AND ? >= 'T' THEN 'T'
WHEN Sum(col3) <> 0 AND ? >= 'R' THEN 'R'
ELSE 'S'
END) as Current
FROM dbo.TABLE1
I am passing the variable by mapping the parameters and then assigning the value using a single row result set.
Can someone please tell me where am I going wrong?
Thanks
View 13 Replies
View Related
Mar 1, 2008
Hi,
I have a sqldatasource which returns the result I want, but I need to assign it to a label or text box. Is there an easy way of doing this? I attempted it using this code:
PropertyFriendIDLabel.Text = PropUserIdSqlDataSource
Thanks
View 4 Replies
View Related
May 22, 2008
Hello,
I am using SessionParameters within a sqldatasource control, which is the datasource for a formview control.
The Session["PoolID"] has a value which is '0000009485'.<InsertParameters><asp:SessionParameter SessionField="PoolID" Name="pool_id" Size="10" Type="String" ConvertEmptyStringToNull="true" />
</InsertParameters>But when I click 'Save' I get the message 'Cannot insert the value null into column 'pool_id'. Column does not allow nulls. Insert fails'.Do i need to specify something like DefaultValue = <%Session["PoolID"] %>?Thank you in advance for your help.RajanP.S. How can I avoid double line spacing while writing a post? Thanks.
View 2 Replies
View Related
Jun 9, 2008
hi all
can we assign two foreign key to one table .
View 3 Replies
View Related
Dec 24, 2003
I’ve reconfigured Microsoft’s IBS Store shopping cart to function within a small e-commerce website. What I am trying to do is to modify the code slightly in order to use a third party credit card processing center. The situation is this: once the customer clicks the final "check out" button, a stored procedure writes all of the product ordering information into the database. I, then, capture what they're wanting to purchase with the following SQL statement:
Dim strSQL as String = "Select orderID, modelNumber from orderDetails" & _
"where CustomerID = " & User.Identity.Name & _
"And orderid = (SELECT MAX(orderid)FROM orderDetails" & _
"where CustomerID = " & User.Identity.Name & ")"
What I would like to do is assign specific values to variables based off of the above query. For example:
Dim orderItem as String = (all of the modelNumbers from the query)
Dim orderIdItem as String = (all of the orderIDs from the query)
How do I do this?? Any help is much appreciated! Thanks in advance.
Ron
View 6 Replies
View Related
Apr 5, 2001
Hi,
I want to give 'Execute' permission for all the sp to a particular user.
Any straight way of doing this then to go to each sp and give him permission for every sp.
TIA.
View 2 Replies
View Related
Dec 6, 2006
i am trying on this but hit error
Declare @var int
Set @var = select max(value) from xxx
anyone can help me?
View 2 Replies
View Related
Aug 18, 2004
Ok guys,
I'm realitvely new to the whole database development stuff, but I have a very important project to finish using SQL and ASP. I am to design a new links manager for a website.
Right now I have the following:
The ability to add a link, and edit it
The ability to add a category and edit it
When you go to add a link, a list of categories is provided for you, with checkboxes. What I need to do is figure out how to assign multipule categories to one link.
I have a Cross-Referencing table with three fields:
CrossRefID
LinkID
and CatID.
If you need more clarification, post here and let me know.
Thanks in Advance,
Aaron Hawn (aaron@ionzion.net)
View 2 Replies
View Related
Mar 3, 2008
Hello everyone. I wanted to learn to assign and change a schema names used in my table. I dont want a dbo. in my tables. I want to give a personal name like the adventureworks database has. (Such as sales.salesdetails, humanresources.employee and all)
> So how i do create a table with a schema name sales
and
> How do i change my for example dbo.employee to sales.employee ??
I tried
Create table sales.employee
{
statements
}
but it doesnt work...
Please reply ASAP
Thanks
into the world of programming now :)
View 6 Replies
View Related
Jul 23, 2005
hello,i would like to loop through a record set and assign each value to thesame string, (example i would like to return all of the first name inthe authors table = Authors_total.)should i use a cursor or just a loop to do this? I have had sometrouble with the syntax in a cursor.nicholas.gadacz
View 4 Replies
View Related
Aug 11, 2007
Hi
I am using SQL SERVER 2000. Until now my application used the default user "sa", but now the illigal access to my database make me move to a more secure login.
i am new to this concept.
i need to create a login, which i am successful in creating, but my problem is
I need to allow only this user to access my database and no other user should login my database.
please can any one explain how to do this.
its very urgent.
regards
James Alvin
View 6 Replies
View Related
Aug 8, 2006
Hi I'm new to SQL and I'm trying to build a store procedure. What I'm trying to find out is how to assign a variable a value from a table.
So, I declare a variable:
DECLARE @variable int
Then I want to assign a single int value to that variable that is already in a table. For instance the id value from a single row in a table.
I've tried SELECT INTO and SET, but nothing has worked so far and I'm lost after searching for a few hours.
Thanks in advance for any help
View 3 Replies
View Related
Oct 4, 2007
I have the following problem:
in a data flow, if inserting new records, there are columns that take some default values. These default values are kept in a table in case the user wants to change them some day. Def. values could not be assigned at a table level because there's another dataflow that populates the same table, but the rules for the default values are different.
Since I want to extract these values only if there is at least one new row, I'm not fond of the idea to use Execute SQL Task (to save the default values in a variable) before the actual Data Flow. What are my options in getting these values in a Data Flow right before inserting? Thank you for the help.
View 5 Replies
View Related
Mar 25, 2008
Hi,
I would like to assign the value of a variable to a column name of a table. For eg:
declare @sam varchar(100)
set @sam = 'Insert'
create table #temp(Sample varchar(100) not null)
insert into #temp(Sample) Values(@sam)
drop table #temp
I would like to generate a table whose column name should be generated dynamically. The value of @sam that is "Insert "should be set to the column name. Is there a way to assign like this. Can anyone please help me in achieving this.
Thanks,
Sana.
View 1 Replies
View Related
Mar 20, 2008
Hi,
1 20031012121212 200 (recordtype, CreationDateTime(YYYYMMDDHHMISS), Rec_Count) -- Header records
2 ABCD, XYZ, 9999, 999999999, 1234 ---- Detailed Record
2 ABCD, XYZ, 9999, 999999999, 1234 ---- Detailed Record
For the above given sample data I am having two outputs at Condition Split (based on the recordtype). I want to store the 1st record datetime value into a variable and then I want to use that variable value into 2nd and 3rd row.
Basically, detailed records would be stored into the database not the header record. Is there any way I can use the variable while doing processing for 2nd and 3rd records.
Please suggest me.
Regards,
View 10 Replies
View Related
Feb 14, 2006
Hi,
I have a parent SSIS package that executes various subpackages. Each of the subpackages contain variables that are required for their successful execution, e.g. one has a variable of datetime datatype and a variable of varchar datatype.
This date will essentially change with every running of the package as it specifies the date that additional data has been added to the back-end SQL Server 2005 database.
I can't find anything in the expressions of the Execute Package Task that would allow me to pass these variables into the package.
Can anyone advise?
Thanks,
Paul
View 2 Replies
View Related