.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

create a new table column with data...

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :ASP.Net
 

I have created a web project using asp.net and visual web developer 2008.  On my local project I created a new column in one of my MS SQL data tables and populated it with data.  How would I create a sql script of the new column and data?  I want to insert this into my live database on Godaddy? 

Thanks,

Photon




View Complete Post


More Related Resource Links

How to create scrolling table for columns in a SharePoint Designer Data View

  

I have a fairly complex SharePoint Designer 2007 Data View they have added two more requirements.

1. Have the columns on the right side be able to scroll left to right as there is a large number of columns, while the first 3 columns on the left side stay locked in place.  This is only one list not two, and because of some other requirements I have it must remain to be just one list.

2. Then they also need to have scrolling up and down of the entire list with the headers locked in place.

The first requirement is more important than the second, but preferrably I need to do both.

I am new to XSL so not familar with the syntax. Is this something I can do on a custom Data View? Does anyone have any examples of how?

I have a drawing that show how it needs to look but I don't see an option here to upload a graphic.

So here is a link to my graphic example uploaded to my blog area: http://lindachapman.blogspot.com/  or just the image here: http://4.bp.blogspot.com/_aB01ue__NvQ/TGL42MOvrGI/AAAAAAAAAA4/c3xP4uCy4BU/s1600/Scrolling.png

I failed to mention that 3/4 of the columns are HTML Calculated fields wh

Excel External Table Data can only create new SharePoint List when Exporting from Excel?

  
I have a SQL Query that I refresh everyday in Excel. I want to be able to export this list over to a SharePoint list right after my refresh in Excel but I can only Export to a SharePoint list only once. If I try to export again to the same list then it will give me the error "The specified list name is already in use on this server. You must rename the list before publishing it to the server." I have web parts that have connections to this list and I do not want to export my Query to a new SharePoint list everyday. Does anyone know a way around this issue?

Update one column of a table with data from another table

  
I have two tables which are different with the exception of a single field (column name = "LocationCode"). Both tables can also be joined with a common id field. I would like to update the "LocationCode" values in one table with the the "LocationCode" of the other table. I can do a relational join on the common id. It is impractical for me to update one row at a time. How can I update all the rows quickly?   But one more point both tables lies in different database Varinder Sandhu http://varindersandhus.blogspot.com/

Update one column of a table with data from another table

  

I have two tables which are different with the exception of a single field (column name = "LocationCode").

Both tables can also be joined with a common id field.

I would like to update the "LocationCode" values in one table with the the "LocationCode" of the other table. I can do a relational join on the common id.

It is impractical for me to update one row at a time. How can I update all the rows quickly?

 

But one more point both tables lies in different database


Varinder Sandhu http://varindersandhus.blogspot.com/

inserting data to Users Table in ASPNETDB from Create User Wizard

  

When a user starts a membership using the Create User wizard supplied by the aspnetdb profile service, I need to add a field to a table in aspnetdb and upon clicking the ContinueButtonClick insert some data.  The field I'll add is "SubscId".  My first question is what table is best for this - Users or Membership?

Secondly, what is the best way to insert new data for this scenario?  code behind?  markup?  Can someone provide basic syntax of insert code in code behind for this scenario?


Add a new column or create a separate table (1billion recs)

  

One of our production table contains about 1 billion records.

There is a need to remove one column and add 2 new columns, then update them.

 

Should I create alter scripts for this and update the table with new values?

or create a new table and load the data from old to new, drop the 1st table and rename the 2nd one.

 

What should be the approach?


~Manu
http://sqlwithmanoj.blogspot.com/

how to create list order and unorder list using data table(asp.net,or jquery)

  

1 My DataTable Return following Data

Acct    Books    Annual
Acct    Books    Monthly
Acct    Tax    Income Tax
Admin    GH    Eqpt
Admin    Offc    Eqpt
Admin    Offc    Misc
Admin    Offc    Eqpt
BPO    DE    DE.US
Corp    Comp    Insurance
Corp    Legal    Court
Corp    Legal    Court

but i require in this format


 <ul>
Acct 
<Ul>  
 Books
<li>  
  Annual</li>
<li>
    Monthly
</li>
</ul>
</ul>
<ul>
Acct 
<ul>
   Tax 
<li> 
  Income Tax
</li>
</ul>
</ul>
<ul>
Admin 
<ul>   GH 
<li>   Eqpt
 </li></ul>

<ul> Offc 
 <li>
  Eqpt</i>
</ul>
</ul>





Table name , Column name from Data value

  

Hi,

   I have 3 tables namely  T1 with column A,B,C and T2 with columns  D,E ,T3 with columns E,F .  A data namely 100 is present in any of the column . Need to find out the column name and Table name where that data exists . Please advice .

Regards

Selvaraj


Can Report Builder mimic something like MS Word's "Column" formatting with a lot of table data?

  

Greetings,

I want to make a report that shows the sign-in of a list of people. There will be anywhere from 40-200 people signing in per day. I need to print this data. The columns in the row are small: [firstname, lastname, id number].

What I would like to do is have 2-3 mega-columns, which each "mega"-column contains [firstname, lastname, id number]. I'm using the phrase mega-column to distinguish from a normal column in the context of a table.

Is that possible with report builder? My production platform is IIS7.5 with ASP.NET 4 and MVC3. I am planning on generating PDFs for the user to print. However, right now it looks simpler to just format html with stylesheets and have that print.

Any help would be appreciated.

 

-Jimmy


Checkboxes from data table

  

I have a data table that contains some values for Certifications.  This table can be updated in a different part of my application.  On the web page I am currently working on, I would like to have check boxes appear for every value in the data table.  I have been struggling with this trying to use a For Each loop and I cannot get it to work for anything.  Any suggestions? 

I am using the following Razor syntax to obtain my data (I know this works because I can display it in a WebGrid):

@{

var db = Database.Open("MyConn");

Display column from child table. Possible ?

  

Hello,

I'am using dnamic entity with EF4. On a list page of a table, I would like to display a column containing information from a child table of the current element. Sample :

Order List :

Order Data | Required Date | Shipped Date | etc... | ... | Customer Name (foreign key with tostring() method override) | Customer Postal Code (Column that I want to add) |

I don't known how to do that. Is it possible ? Maybe I have to to create my own Metadata proxy that will add dynamicly a column on the MetaColumn list of the table.

Does someone have an easier or better idea ?


Thank you for any help.


Rendering data with HTML tags in the DD Gridview for a selected column

  

I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                // Html Encode the cells
            }

        }

but this event never fires?


Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!


Create new sql table at runtime VB.Net

  

I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")

objConn.Open()

How to get data from table based on four table

  

Hi..

I need to know how to show top 30 records from four table

with fastest speed.. in ms sql server 2005..

hope You do the needfull

  


Create ID (uniqueid?) from two fields when data is entered

  

I need to create an ID from two fields when they are entered into the db for the first time.  I thought Uniqueidentifer would do this, but it looks like uniqueidentifier is random and i have no control of the process. 

My user will enter 4 letters into a column called INIT and 4 numbers into a column called NUMB.  What I would like to do is create an id by combining those fields.

How can I do this?

Thanks!

 


Create/add table from code to database

  

Hi,

I create table:

                  DataSet data=new DataSet();

                  DataTable myTable = new DataTable("NewTable");


                   DataColumn[] keys = new DataColumn[1];

                   // create column
                   keys[0] = new DataColumn();
                   keys[0].DataType = System.Type.GetType("System.String");
                   keys[0].ColumnName = "PointID";
                  
                   myTable.Columns.Add(keys[0]);    &nb

Data Points: Deny Table Access to the Entity Framework Without Causing a Mutiny

  

Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.

Julie Lerman

MSDN Magazine August 2010


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend