DataSource Controls :: How To Use Sql Server To Get Information On A Particular Day
Apr 30, 2010Im trying to write a sql Procedure that will get information on the day a user specifies.
so far i have written:
set ANSI_NULLS ON
Im trying to write a sql Procedure that will get information on the day a user specifies.
so far i have written:
set ANSI_NULLS ON
I'm using SQL server 2005 and Visual Webdeveloper 2008 express.
I have a database created and I've successfully connected to it. My question is, would it be possible to do something like search the first column of a table for a value, get the index of that row and use the index to get the value of each column? Sort of like you would with an array.
Are there are good tutorials out there that I could use, everything I found shows you how to display your information in a datagrid, which I've already done, but I can't find anything on how to get an individual row's information.
How can I retrieve information from delete rows. I delete some rows from table in dataset, then I use method GetChanges(DataRowState.Deleted) to get deleted rows. I try delete rows in original table on server side, but it finished with this errors. I try get value of columns from row, which was deleted
[Code]....
I would like to check my database for to see if a user name is available but my script isn't working.
I am taking input from a text box call unametextbox and i'm trying to extract any matching username from the database, this is my code.
[Code]....
It's probably something small but I can't seem to find what went wrong. I am trying to insert information into my database. It goes through the code just find but it doesn't insert into my database. Here's my code:
[Code]....
Here's my webconfig connection string:
[Code]....
I have a C#/Asp.net web application which caches SQL DB schema information. Is there a way that I can determine what child relationships a given table has? I have looked into using the DataTable.ChildRelations property, but it is never populated with items unless i manually create a relationship using the .add property. I also have access to DataColumn information for each column in the database.
View 4 Repliesi am making a simple cms system
but I have a problem when updating some information
here is the code
[Code]....
and in the page load everything is fine
[Code]....
Basically the main page has a couple of DataSourceObjects sucking information from a local database and displaying them on the page. The page is a form, which then generates an HTML email and fires it off using the SMTPClient. The problem is that I cannot seem to get the data from the database to be accessable from the code-behind. Attempting to get data from either of the ListViews results in a number of Null Exception errors, mainly when using the ExtractItemValues method. The OrderedDictionary that comes back always seems to be empty. So I figured I'd use one of the 3 Object Data Sources I already have set up, that queries the actual database, but cannot find any way of calling the Select statement present in either of them, let alone managing to store and access what comes back.
View 1 RepliesI have a website that displays information from my database into a gridview. The gridview has a checkbox, that once selected, is suppose to move a 'Y' into the field that has the checkbox selected. I have it generating the code, and displaying the code on my page to confirm, but the database is not being updated. Here is my code,
[Code]....
I need to enter text in sql in nvarchar(max) .. the text contains titles and paragraphs.
I was using a separate table called paragraphs to enter paragraph title and paragraph content. These get a 'article ID' so I can read them out of SQL. On my page I format title and content differently.
Now I was wondering if I can enter Title format information into sql (as the <br/>) tags, so that i can enter all article information into 1 table column.
I'm using Content Management System, DotNetNuke for my dynamic website. DNN itself they have one database, I named it dnnDB. Inside the dnnDB they have the users table which have the list of users. I need to be able to pull this set of information or synchronize to my own database, myDatabase for development purposes. I do not want to incorporate my database into dnnDB, afraid that I may corrupt the system.
View 4 RepliesMy sqldatabase is inputting NULL instead of the information from my form. Form is collecting different names and multiple phone numbers for each. names, addresses, zip codes are going in as entered on form but phone numbers are not they are going in as NULL. Columns are set as header is Cell, nvarchar, Length is 15 and I have setup as I did other columns. code for my form is (i have removed some lines that are working as expected)
[Code]....
In the table save your credit card.I want to encrypt all credit card information to be recorded in the database.
View 2 RepliesI build a webpage to edit the data entry, all the textbox wroks fine. However when I update the value originally took in using dropdown list , I get error and couldn't get correct update.
View 2 RepliesI am using an SQL Express server hosted on a different machine and it is listed in my server explorer just fine. It is listed as my connection string in my web.config just fine as well and lastly it seems to sync just fine with my asp.net membership tables. My question is does it need to be listed in my app data folder of my site? Currently I have the ASPNETDB.mdf connection listed, which is apparently just a local sql express connection. The database I am using in my webconfig and other files is not listed so do I need to add it there?
Second question is about DAL, Data Access Layers. I have mostly been using presentation level SQL commands with my data presentation controls. Manually entering separate select, insert and update statements. I just went through a tutorial that stated the best way to interact with your database in asp.net is with DAL using table adapters. It mentioned that it gives you the ability to use strongly-typed references to each row. My question is can I use the same method multiple times on a single page. For instance a method inside an adapter named GetProductsByID(@ID) ? What if I want this bound to three different gridviews on a single page? Anyone have any other general things to point out about using DAL over presentation level commands?
I have some issues about retrieveing and storing date information to my database (ms sql server 2005).My data column is a DateTime, and i have set my web.config globalization culture is set to "en-gb"
When i retrieve date from the datebase it appears as dd/MM/yy, that's fine. But i cannot insert a new date as same format?! It will only accept MM/dd/yy or yy/mm/dd.Right now i'm using this code to correct the error:
[Code]....
Is it possible to change the date format on the database or something, so i dont need to use this code?
How to insert data from local SQL server to remote SQL server (without using linked server) like below?
insert * into [remote server].[northwind].orders
from [local server].[northwind].orders
I have to programmatically import a table from a database "A" in Sql Server 2000 to a database "B" in another server 2005.
View 1 Repliesi am trying to create connection using OLEDB connection in my app. but i am not able to create the connection as in datasource i want to use Server.mappath, but cudn't find the right method to use it. i am trying to make connection with Access database file. following is code i have tried:
string path = Server.MapPath("~/uploadaccess/Production.mdb");
string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("~/uploadaccess/Production.mdb")&";";
and also
OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & path&";");
and tried this
OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("~/uploadaccess/Production.mdb"));
and this is the error i am getting:
Operator '&' cannot be applied to operands of type 'string' and 'string'
I want to add a page to an existing website with a list of practical system information about the server that's running the site. For example, which windows version, 32 or 64 bits, SQL Server version, some host variables, amount of RAM, disk space and whatever else. Basically, anything practical that could tell me more about the health of the server. So, how do I get the most practical information through .NET?
Not important how it's going to be displayed but assume it's a list with three columns: Name of the setting, value for the setting and a description that tells what the setting is for... (The first two would already be enough, though, but for clarifications a description would be nice.)
One added complication, though: I need both 32-bits and 64-bits solutions...
I have a problem with rdlc report in MVC:I use sql query to create a table( with joining many tables & group by) and using this query to create a table adapter in dataset: SELECT tblPersons.PersonFullName, tblClasses.ClassName, tblSemester.SemesterID, tblReasons.ReasonName, tblAttendance.AddDate,
[code]...
My problem is when i use the sql query in sql server i can see the infor i want but nothing appear on when i use linq statement.If i use simple linq like " from m in tablename select m", then bind it into reportviewer. I see all infor from this tablename.But with joining multiple table,it not happen.
Migrating SSIS package from SQL Server 2005 to SQL Server 2008
View 1 RepliesPrevious developers have developed a .SSISDeploymentManifest file (SQL Server 2005) to install SSIS packages which prompts a Package Installation wizard. I tried to install it on SQL Sever 2008 (it works on SQL Server 2005), but it failed with the error: "Storing or modifying packages in SQL Server requires the SSIS runtime and database to be the same version. Storing packages in earlier versions is not supported".
How do I install 2005 SSIS packages on SQL Server 2008? I have all the .dtsx files, not sure how to install them?
I have 5 GB data, when I move from SQL server 2000 to 2008 with Import and Export wizard, my LDF size is increased to 30 GB, Can I reduce my LDF file or move. In my one of the table contain around 20 Lakh data which i have normalized in 2008 and create 4 tables, so my data is entering in normalized form in 2008. But due to size by hard disk is full. I have used shrnik command but it reduce to only 1 GB.
View 5 RepliesWe have a cient we are stting up that has 2 separate physical servers, one that is the web server the other the database server. Using impersonation we have been able to get the website to connect and retrieve data from the sql server so that part is not an issue. The problem is I have a windows service application that must be installed on the web server (as it process files downloaded to an ftp site) and it must be able to connect and write to the sql server as well.We tried adding a system.web block with the impersonation stuff to the app.config file which of course did not work. Can anyone tell me what/how we need to configure this properly?
View 7 Replies