How Can I Populate An SQL Database Graphically?

Feb 23, 2008

I am writing a small program (Visual Studio Express 2008) to help me automate populating a database graphically. The program I am writing will keep track of sales figures state by state on a map of the US. This will be accomplished by using a map of the United States overlaid with a hexagonal grid that represents individual sales regions (hexagons). Each hexagon represents a specific sales region, and there can be many sales regions within a state. This small program will populate the database with data specific to each hexagon that is selected by clicking on it with a mouse. A complete set of row entries should be sent to the database every time the mouse is clicked in a hexagon on my map. This program will capture such information as the center x,y pixel coordinates of each hexagon, row & column location of each hexagon, and the state where the hexagon is located. All of this information (HexX, HexY, RowX, RowY, State) has already been figured out or calculated, except that I need help on how to capture, display, and send this information as a new row entry into my database. I need to populate the database hexagon by hexagon, since which state they are in is determined visually.
Here is what I need to populate my database with:


Hex_No - each unique hexagon needs to have its own unique number 1,2,3,€¦.n. This should be as easy as assigning a counter that starts at 1 and increments until all hexagons have been processed

Hex_X €“ the pixel x value of the center (x,y) of the specific hexagon, which is known by the program

Hex_Y €“ pixel y value of the center (x,y) of the specific hexagon, which is known by the program

Hex_Col €“ column location of this specific hexagon, which is known by the program

Hex_Row€“ row location of this specific hexagon, which is known by the program

State €“ the current state on the map. This will be selected by me (combobox) prior to clicking on each hexagon within a given state
Each of the above is represented by a textbox on a form, except for the State field, which is represented by a combobox. When one clicks on the down arrow of the combobox, one can see that the names of the different states have already been entered and linked to the SQL database. The other textboxes are also linked to a different column in the same database; however they are currently empty due to the fact that this is the very data that needs to be captured by this program. This is what I need for this program to do for every mouse click , once I have moved on to a given hexagon within a given state:


Determine next available Hexagon Number, and assign it to current hexagon, display in textbox, send this as part of row data entry under Hexagon_No column

Capture and display the current hexagon€™s center x, and y (Hex_X, Hex_Y), display this in textbox, send this as part of row data entry under Hex_X, and Hex_Y columns

Capture and display the current hexagon€™s row and column information (Hex_Col, Hex_Row), display this in textbox, send this as part of row data entry under Hex_Col, and Hex_Row columns

Capture and display the current State that is selected manually from the list of database values, send this as part of row data entry under State column
Here is an example of what this program might look like in action:
http://farm4.static.flickr.com/3172/2285817199_d75f230f8d_o.jpg
I am not looking for anyone to write my program, but I would appreciate some ideas on how I can accomplish this. I have figured everything out except the part about displaying the new information on the textbox/combobox form, and sending it to the database as the next row entry. That€™s the part I need help with.
Thanks.

View 6 Replies


ADVERTISEMENT

Building Query Graphically

Sep 13, 2007

Hi,

I'm using 2005 management studio express.

Can I use the graphical query builder to specify tables from more than one database?

I know I can do this in sql in the format database..table.column but in the query builder it only shows tables from the current database. Can you get around this?

Thanks

View 1 Replies View Related

Cannot Access SQL Server When Using Controls Graphically

Nov 3, 2006

Hi, i wrote a simple program to access a SQL Server 2005 DB and i use the following connection string: <connectionStrings>
    <add name="Alunos" connectionString="Data Source=.;Initial Catalog=ALUNOS;integrated security=true"/>
    <add name="Escola" connectionString="Data
Source=.SQLEXPRESS;Initial Catalog=Escola;integrated
security=true"/>
  </connectionStrings>   It all works fine.Then 
i try to create a SQLDataSource object graphically and configure it.
when i choosethe instance and DBi choose Test Connection and it gives
the 'Named Pipes Provider , error 40'. I think i solves this problem
because i googled thisand found a lot of info and i did all that.But
the problem remains.Could it be the a security issue? with the user i´m using to access the DB?Some help on this would be very appreciated.ThanksSP 

View 2 Replies View Related

Populate Database Tables With Data From Another Database

May 2, 2008



I have two Databases with the same name that reside in different servers. The two servers are linked servers. Each database consists of 5 Tables. The tables have identical names in each database.

The database in ServerA has 5 tables with data, the database in ServerB also has 5 tables with the same schema as ServerA, however the 5 identical tables in ServerB contain no data.

I need to populate the 5 tables in ServerB with the Data from the 5 tables in ServerA.

What SQL code or script can i use to populate the 5 tables in ServerB

Below are the names of the 5 tables:

TABLE1: [ServerB].[ProdDB].dbo.[Orders]
TABLE2: [ServerB].[ProdDB].dbo.[Sales]
TABLE3: [ServerB].[ProdDB].dbo.[Employee]
TABLE4: [ServerB].[ProdDB].dbo.[Customer]
TABLE5: [ServerB].[ProdDB].dbo.[Region]


Does any one have a script that could help me with this task. Thanks

I am using SQL Server 2005

View 2 Replies View Related

Populate Arraylist From A Database

Sep 15, 2006

Hi  i'm pretty new to this, how do i connect to my database a put all the values from one column into the arraylist. Any help and a easy example would be nice Thanks in advance  Richard 

View 4 Replies View Related

Populate The Array From Database

Oct 18, 2006

Hi,   I want to populate the array with a single column values from database(sqlserver 2000)Ex. name      ageaaaa         23bbbb         43cccc         18 Now i want to populate the array with name field values. Please anyone guide me how to do this.Thanks in advanceBala

 

View 3 Replies View Related

Populate Textbox To Edit Database

Jun 18, 2006

hi
i have a database with a table with several columns:
ID - primery key
customer
company
now lets say i want to edit one row in the database and i have the primery key ID for that row. so i click on that row (which is displayed in a gridview) when i click I want the text that is in the customer cell to appear in a textbox1 and the same with compeny text I want it to apear in another textbox2.
so what code can i write in the GridView1_SelectedIndexChanged eventhandler to populate the textboxes?
thank you

View 3 Replies View Related

Trigger To Populate Table Or Database

Jun 3, 2006

Im a newbie with a sql table in a MSDE database that contains fields ofCustName, BrokerName, Type, Status.I am trying to write a trigger that does this:1. When a new record in a table is added, I would like the selectedfields to be copied to another table (call it Master).2. If that Master table already contains a record where the CustName =CustName, then simply ignore. If CustName does not match anything, thenadd the record to the Master TableIn other words, I am trying to create a table (or even a new database)that has unique records in it - making a master customer list.Any hints on how to get started on this?

View 6 Replies View Related

Using SSIS To Populate Database From IIS Logs

Jul 12, 2007

Hi,



I need to write a reporting app that process daily IIS logs that are averaging about 299MB a day!



I am considering using SSIS to put the log data into a sql server 2005 database.



Has anyone done this? Or does anyone know if it is possible? And without using the MS LogParser?



Thanks in advance and any help greatly appreciated!



Regards,

kitquo2.

View 4 Replies View Related

Using One Database Call To Populate 8 Grid Views

Apr 23, 2008

Hi
I'd like to be a little more efficient in my approach when using databases. Although my site is very simple with a low hit rate expected, I would still like to learn the best methods in designing server load conscious code.
Basically, I have a page where I'd like to show events broken down into days of the week (Monday - Sunday). All the events contain the same data and only difference being the day. Right now, the only way I know how to make this work is to create a unique sqlDataSource (select * where Day = Monday) then assign it to a ‘Monday’ grid view. I then repeat this same process for each day of the week.
As the data is always the same, is there a way to make only call to the database returning all the data, then close the connection and then separate the data there after. To me this seems to be a much more efficient way to manage the data???
Thanks for any help/supportRichard

View 4 Replies View Related

How Do I Quickly Populate A New Database With Place-holder Content?

Apr 28, 2008

I am using SQL server to create a rather complicated client database for a nonprofit organization. I have access to an ancient version of the database in Access format, but would rather create a new database from scratch instead of "up-sizing" the old database. Although the old database is mostly useless, it contains a goldmine of names and addresses that I could use to populate the new database that I'm creating. My question is this: Is there any relatively easy way to cut and paste from external data sources into a new SQL database? For example, I would love to just select twenty rows of "first names" from the old database and then paste that into my new table. Can anyone suggest any quick and easy tricks for populating a new database with place-holder content? Thanks! 

View 2 Replies View Related

Suspect Database Attempting To Populate Large Table

May 2, 2007

I am trying to load in to a new application's database to see if my load procedures will be able to handle the volume and how long I should plan on when I perform our cut over for production. Unfortunately, trying to copy 5.4M rows from one staging table into a production processing table consistently leaves the database in a suspect status, usually stating to perform some type of disk consistency check utility. It happens time after time, is there anything obvious that I could look at to see why this is happening?

View 3 Replies View Related

SSIS: Populate Database From A Space Delimited File

Aug 9, 2007

The problem is that I have (for example) following data

AAAA AA ALH
B BBB MIL
CCCCCC CAC Q
D D P

in space delimited file and i want to populate a database using SSIS and it is not working. Any suggestions will be appreciated.


P.S. the only way to recognize colums is through spaces b/w the data.

View 5 Replies View Related

Accidentally Populate Tables Into System Databases/master Database

Jul 31, 2007

Hi,

I accidentally populate tables into System databases/master database. What should I do? Should I delete all the tables I populate in mster database?

Thank you very much!

View 4 Replies View Related

Boolean: {[If [table With This Name] Already Exists In [this Sql Database] Then [ Don't Create Another One] Else [create It And Populate It With These Values]}

May 20, 2008

the subject pretty much says it all, I want to be able to do the following in in VB.net code):
 
{[If [table with this name] already exists [in this sql database] then [ don't create another one] else [create it and populate it with these values]}
 
How would I do this?

View 3 Replies View Related

Ddl Doesn't Populate

Feb 6, 2008

Anybody see a reason why this list won't populate?
<asp:DropDownList ID="ddlState" DataSourceID="srcStates"    DataTextField="StateName" DataValueField="StateName" runat="server">    <asp:ListItem>Select State</asp:ListItem></asp:DropDownList><asp:SqlDataSource ID="srcStates" runat="server" ConnectionString="<%$ ConnectionStrings:webConn %>"    SelectCommand="sp_States" SelectCommandType="StoredProcedure">    <SelectParameters>        <asp:ControlParameter ControlID="ddlState" DefaultValue="Select State" Name="State"            PropertyName="SelectedValue" Type="String" />    </SelectParameters></asp:SqlDataSource>

View 6 Replies View Related

How Do I Populate A Listbox From A SQL DB?

Feb 10, 2004

Sorry if this is to basic but I am just starting out. Any help is appreciated.

Basically I am attempting to populate a listbox with items from a MSSQL DB so the user can select either one or multiple items in that listbox to search on.

View 1 Replies View Related

Need To Populate Columns For Whole ID

Feb 2, 2015

I have data like below, I need to populate the ID_INDICATOR columns with the below condition

ID TASK_ID TASK_COMPLETEDTSTASK_DUETSTASK_INDICATORID_INDICATOR
112014-06-09 00:00:002014-06-11 00:00:00GREEN
122014-06-13 00:00:002014-06-14 00:00:00AMBER
132014-06-17 00:00:002014-06-16 00:00:00RED
142014-06-17 00:00:002014-06-18 00:00:00AMBER

Condition:
##########

Red = If ID due date was overdue, i.e. if last task completed after the ID end date(2014-06-18 00:00:00).
AMBER= If any task in the ID is overdue but completed before the ID end date(2014-06-18 00:00:00)
Green = If all tasks were completed on time.

I am looking for the logic to implement the AMBER for the whole ID, because the TASK_ID 3 is overdue, but completed before the ID end date (2014-06-18 00:00:00).

View 6 Replies View Related

Trying To Populate A Name Column

Sep 18, 2006

I am trying to update a name column in the following way: (I wrote a description, but I think this visual is easier to understand).

This is what I have:

name1 name2 address etc

Bob null 123 street

Sue null 123 street

Jack null ABC circle



This is what I want:

name1 name2 address etc

Bob Sue 123 street

Jack null ABC circle



I'm just trying to get 2 names on the same row if they have the same address and get rid of the spare row. Name2 is currently null. Seems simple enough but I don't know how to do it in SQL. I can do it in FoxPro, but that doesn't help me here.

Thanks for any ideas.





View 3 Replies View Related

How Do You Populate A New Index?

May 5, 2008

I added an index to a SQL Server 2005 table. How do I populate that index? I thought it might be automatically populated but the operation to add the index happened so quickly that I don't think it could have done it that quickly. Also, I expected faster performace when selecting rows based on the indexed column, but performance remains the same.

View 1 Replies View Related

Populate A Variable

Oct 24, 2006

During a dataflow - I like to populate a variable with True or False based on a value in one of the data records.

How do I do this excercise ?

 if I use a script - can someone provide me with simple script on how to populate one variable ?

 

Thanks heaps

 

 

 

 

View 11 Replies View Related

How Can I Populate Data In A One-to-one Relationship

Jul 20, 2006

Here is what I have and (somewhat understand).  I’m using Visual Web
Developer 2005 Express Edition and have setup my application to use form authentication
(which automatically creates the ASPNETDB.MDF file with several default tables
and views).  I’m using the CreateUserWizard
which is fine…but I need to collect additional information like (firstname,
lastname, address…and on..).  What I’ve
done.  I’ve created a tabled named
UserProfile and set UserId as the primary key (uniqueidentifier). 
 I then setup a 1-to-1 relationship
between aspnet_Users and UserProfile (which I think is correct).  On my UpdateContactInfo.aspx page (where
users go to update their personal information) I use a hidden label control
(UserValue) to receive the UserId during the page_load event as below:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load        UserValue.Text = Membership.GetUser().ProviderUserKey().ToString()    End Sub Now with the UserID available I need to populate the
UserProfile table with the UserId, firstname, lastname, address of the
currently logged in user.   How can I do this and am I on the
right track..?

View 6 Replies View Related

Populate Binay Data

Oct 16, 2006

We have stored large text data in "Image" data type in SQL Server. Can someone tell me how to get that vlaue from image datafield. Thanks

View 3 Replies View Related

Populate DB Records In Array

Nov 9, 2006

Using the SqlDataReader, I am retrieveing records from a SQL Server 2005 DB table. Since I am using the SqlDataReader to retrieve the records from the DB, I have to use the Read method of the SqlDataReader like this:Dim sqlReader As SqlDataReaderWhile(sqlReader.Read)    Response.Write(sqlReader.GetValue(0) & "<br>")    Response.Write(sqlReader.GetValue(1) & "<br>")    Response.Write(sqlReader.GetValue(2) & "<br>")End WhileThe records retrieved can only be accessed inside the While loop. I want to access the records outside the While loop as well. Is there anyway by which I can do this, maybe by populating the recordset in an array variable & then using it outside the While loop?

View 3 Replies View Related

How To Populate A ArrayList With A IDataReader

Jan 18, 2007

In my data access layer class I have Populate methods on the bottom.One of the the objects, color, is an ArrayList, how do I write that?         private Product PopulateProduct(IDataReader r)        {            Product product = new Product();            product.BrandId = Convert.ToInt32(r["brandId"]);            product.BrandName = Convert.ToString(r["brandName"]);            product.Color = whatGoesHere?  (r["color"]);  return product;        }  thanks 

View 4 Replies View Related

Populate Automactly UpdateParameters

Jan 29, 2008

 Hi there!I'm trying to populate automactly a record in a table. I've tried this:   <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ProducaoLigacao %>" SelectCommand="UPDATE [Producao] SET [Prodas] = @Prodas WHERE ([ProdUserID] = @ProdUserID)">
<UpdateParameters>
<asp:Parameter DefaultValue="1" Name="ProdUserID" Type="Int32" />
<asp:Parameter DefaultValue="999" Name="Prodas" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource> Is this possible? Thanks in advance! 

View 5 Replies View Related

Populate Dropdown Box From SQL In Web Matrix?

Jan 22, 2004

I have been attempting to populate a dropdown (combo) box from a SQL query (SQLConnector) in Web Matrix and I have so far been unsuccessful. I have been able to populate a DataGrid just fine from the query, so then I limited it down to one colum (so itd be in the dropdown box) and set all the properties I could find (DataSource, DataMember, DataTextField, DataValueField) (and in all possible combinations) for that dropdown box to the SQL stuff (SQLConnector for the DataSource and then used the dropdowns for the others), and nothing shows up in my dropdown box. How can I make this populate off of my SQL query properly?

Additionally I will need to do the same thing for a Checkbox List so if it is the same and you know how to do that and could let me know for that too that'd be great.

Thanks a million in advance!

View 1 Replies View Related

Two DB Tables To Populate One Control

Jun 20, 2004

I have a dropdownlist that is populated from a DB table. I would like to also include any other values that might be in another table. How do I combine these two queries, so I can get distinct values from both tables combined?SELECT Category
FROM dbo.TABLE1
GROUP BY Category

SELECT Category
FROM dbo.TABLE2
GROUP BY Category

View 1 Replies View Related

Populate Textbox From DataSource

May 15, 2006

Can someone tell me what I am doing wrong... I am trying to populate some textboxes from a table by doing a SELECT statment. 
Any help would be greatly appreciated
T.
 
Code:
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
myConnection = New SqlConnection("Server=.SQLEXPRESS;AttachDbFilename=|DataDirectory|CustomerInfo.mdf;Integrated Security=True;User Instance=True")
myCommand = New SqlDataAdapter("SELECT * FROM [CustomerSalesNum] WHERE [WorkSheetID]= '" & lblRWorkSheetID.Text & "'", myConnection)
Dim ds As DataSet = New DataSet("CustomerSalesNum")
ds = New DataSet("CustomerSalesNums")
tbUPPRice.Text = ds.Tables["CustomerSalesNums"].Rows[0]["Price"].ToString();

View 5 Replies View Related

Populate Star Schema By DTS

Dec 18, 2002

does any one know how to built a star schema by DTS:confused:

View 4 Replies View Related

Please Help Me Populate My Date Fields

May 7, 2004

Hi,

I have the following table:

CREATE TABLE [Orders] (
[OrdID] [int] ,
[OrderDate] [datetime] ,
[OrderDateONLY] [datetime],
[OrderDayName] [nvarchar] (15),
[OrderMonth] [nvarchar] (25),
[OrderDayOfMonth] [smallint] NULL ,
[OrderWeekofYear] [smallint] NULL
)
GO

The field OrderDate contains BOTH Date and Time information. What I want to do is populate the fields (in bold above) from the OrderDate field... I have tried all that I could think of but nothing works. The last and the best try that I gave was the {B}following[/B] but that too does not work. Can you PLEASE help. Many thanks in advance:


Insert ORDERS
(OrderDateONLY, OrderDayName, OrderMonth, OrderDayOfMonth, OrderWeekofYear)
select
d, datename (dw, d), datename (mm, d), Year (d), datepart (ww, d)
from
(select convert (char (8), OrderDate, 112)as d
from ORDERS
) as x

View 3 Replies View Related

Using Cursors To Populate A Column

May 10, 2002

I am trying to populate a column with date/time info, I am doing this so I can use getdate() on the data for other computations (the format is mon/day/yr/hours/mins, i was told only data having mon/day/yr format can be used with getdate()). The code below says that dateyest is an invalid object name. Actually, any kind of insert I do reports the same error, no matter what column it is (securty on my account is all set, as well as for the stored proc.). I must be overlooking something very simple, right? thanks for the help!

DECLARE @dateYest datetime
DECLARE Cur668 CURSOR
Keyset
FOR
SELECT cast(date1 as datetime) dt
FROM baclosetable
OPEN Cur668

fetch next from cur668 into @dateyest

WHILE @@FETCH_STATUS = 0
BEGIN
if @dateyest is not null
Insert dateyest VALUES (@dateYest)
fetch next from cur668 into @dateyest
END
CLOSE Cur668
DEALLOCATE Cur668

View 5 Replies View Related

Using Other Columns To Populate Filename...

Feb 23, 2006

Basically like the topic says, I need to populate a filename with data from other columns and im having a tough time doing it.

Code:


UPDATE nice_cls_calls_0027
SET vcarchivepath = 'G:Nice Storageicestorage.safeautonet.netSafe Auto Task - Logger (807101)2006_feb_1SC_807101_'start_time'_'=stop_time'_'=channel'_'=cls_call_id'.aud'


I need start_time, stop_time, channel, and cls_call_id to populate the filename. The first 2 are datetime fields in the db and no conversion is needed for them, just raw data. The remaining two are smallint and raw data is needed there also. Any help would be greatly appreciated. TY

View 4 Replies View Related







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