Does Anyone Know Where To Find A Simple Sample Code That Uses Asp.net 2.0 And SQL 2000 To ....
Nov 28, 2006
Does anyone know where to find a simple sample showing you how to use asp.net 2.0 with the login control to direct you to another aspx page using SQL 2000 as the database on a hosted server? I have been beating my head against the wall trying to figure this out and would be very appreciative if anyone knows a place out there that shows this? I can find many sites that show you how to do this with SQL 2005, but not SQL 2000. Thanks - Chris
View 4 Replies
ADVERTISEMENT
Apr 16, 2007
hi
How to upload excel data to sql server 2000 thorugh .net application.
I want like one upload button should be there,we have to browese corresponding excel file and then we need to upload to database.
before uploading it has to ask appending or replace everything in table.
both options appending and replacing shoulb be there.
How to upload ?
any sample code is there plz give me.
Please help me.
Thanks.
View 1 Replies
View Related
Mar 28, 2006
Hi
Books online mention the existence of sample code for several custom tasks, including the one mentioned in the title. But, when I try to find this code in the location mentioned it is nowhere to be found.
I have run a search on the rest of my drive and come up empty.
Can anyone tell me where to find this?
Thanks
View 3 Replies
View Related
Mar 28, 2006
Hi,
I neew a small sample code in VB.NET to create a custom data flow component for SSIS.
All the examples I was able to find it are in C#.
Answer very apreciated.
View 3 Replies
View Related
Dec 9, 2003
hi,
Does anyone have any sample code for using ntext data type, when inserting or reading big block of texts? How can you read a big huge block of text back into c#?
thx
-Philip
View 1 Replies
View Related
Nov 2, 2006
This is a sample code from an MSDN help site. I copied it and pasted into an open new query. I tried to execute it and got two errors:
USE AdventureWorks;
GO
DECLARE @tablename sysname
SET @tablename = N'Person.AddressType'
table_loop:
IF (@@FETCH_STATUS <> -2)
BEGIN
SELECT @tablename = RTRIM(UPPER(@tablename))
EXEC ('SELECT ''' + @tablename + ''' = COUNT(*) FROM '
+ @tablename )
PRINT ' '
END
FETCH NEXT FROM tnames_cursor INTO @tablename
IF (@@FETCH_STATUS <> -1) GOTO table_loop
GO
The errors are:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'PERSON.ADDRESSTYPE'.
Msg 16916, Level 16, State 1, Line 9
A cursor with the name 'tnames_cursor' does not exist
The database is connected. Table Person.AddressType is a part of it.
What is wrong?
Thanks.
View 1 Replies
View Related
Apr 8, 2004
hi,
i learn by practice and i would like an asp code using c# that connects to sql database can retrives information from a table.
can you please copy paste me some code or give me exact link a?
thank you
View 1 Replies
View Related
Dec 20, 2007
I was thinking of using a CTE to return history, have you ever done this?
I know this can be done in other ways but I wanted to wrap this CTE in a view so people could join to it.
Here is an example table:
KEY ASOFDATE
A 1/1/2007
A 3/1/2007
B 1/1/2007
B 2/5/2007
B 3/6/2007
I want the results to look like:
KEY START END
A 1/1/2007 3/1/2007
A 3/1/2007 NULL
B 1/1/2007 2/5/2007
B 2/5/2007 3/6/2007
B 3/6/2007 NULL
This would be even better:
ID KEY ASOFDATE
1 A 1/1/2007
2 A 3/1/2007
3 B 1/1/2007
4 B 2/5/2007
5 B 3/6/2007
I want the results to look like:
ID KEY START END
1 A 1/1/2007 3/1/2007
2 A 3/1/2007 NULL
3 B 1/1/2007 2/5/2007
4 B 2/5/2007 3/6/2007
5 B 3/6/2007 NULL
View 1 Replies
View Related
Apr 18, 2008
Hi,
If somebody have worked on providing the code for the selection of delivery method and delivery schedule page in aspx . Then please share it with me. I am working on creating a Subscription page using aspx rather then reporting services page.
Please let me know if there are any controls provided by reporting services or some 3rd party for this.
Thanks & Regards,
Sam
View 3 Replies
View Related
Apr 22, 2006
i am writing a graduation thesis about clickstream datawarehouse with SQL Server , now who can give me some samlie about it? I just only want to learn it,thank you! :)
View 1 Replies
View Related
Oct 2, 2006
I am trying to write a ssis surrogate key data transform, my problem is I can't find an example how to add a column to the incoming columns and add some data to it. If anyone has a sample, can you please post it. I found a script option that works but I would like an actual transform.
Thanks
View 2 Replies
View Related
Jun 27, 2007
I am looking for some examples of code for an appliction which will let run RS reports from a custom application. The user will choose the reports from a menu structure
We have an exiting application which we use to run crystal reports which we are going to be migrating to RS. We use custom web controls to capture the required parameter values for the reports, and hope to reuse the same controls (with minimal rework) to capture the parameters values for the RS reports.
What I am after is some code which will
a) let me run the report and display it. I don't want to display the report parameters in the URL etc as we generate some report parameter values based upon the user's ID and do NOT want them displayed back to the users
b) export the report to PDF, CSV etc depending upon the option chosen by the user.
The application will be developed in VS 2005 - VB. Does any one know of some links to some sample code
View 1 Replies
View Related
Mar 26, 2007
Hi, there;
I try to import data from ODBC using C# programmatically. Is there any sample code we can have a look. Like how to read schema from ODBC source table and then create source column...
Thanks
View 3 Replies
View Related
May 15, 2007
Greetings,
I have been developing VBA apps in Access and Excel for sometime and am fairly proficient in VBA. Now we are moving all of our data to SQL Server 2005. I am in need of learning how to write code for the Script Component of a data flow task. And so I have a couple of questions.
First, are there any books you recommend for learning ???? (I'm not even sure what I need to learn: .NET? ADO.NET?)
And as a follow-up, any good websites that provide good reference documentation?
And my second question is more specific to my current problem. If I had a bit of code to get me started, I'm sure I could scream all the way to the bottom of the hill.
Data source is coming from a sort task where the data is sorted by STATUS and then MOD_DATE and the AUDIT_ID.
I need to read each row and compare it to the next row. If STATUS is the same, discard the second row.
When STATUS is different, send the first row to the output (to be used by the next task in the data flow).
Using the "different" row from step 3, go to step 2.
I know how to write if statements, case statements, for/next statements. I'm just not understanding how to read the rows in and then send them back out. I've been searching for some sample code but everything I find tends to be solving much bigger issues.
Any help you can provide would be much appreciated.
Rob
View 2 Replies
View Related
Feb 23, 2007
Hi All,
Are there samples for working with Inegration Service ?
As I see in shipped samples are C# and VB only.
Particulary I need a C++ code for "Enumerating Available Packages Programmatically"
Thanks a lot.
Sergiy
View 3 Replies
View Related
Jul 28, 2005
In the "Example: Detecting a Poison Message" section, it reads: This Transact-SQL example shows a simple, stateless service that includes logic for handling poison messages. Before the stored procedure receives a message, the procedure saves the transaction. When the procedure cannot process a message, the procedure rolls the transaction back to the save point. The partial rollback returns the message to the queue while continuing to hold a lock on the conversation group for the message.
View 1 Replies
View Related
Aug 18, 2007
Is there any sample code to demo the SSB send messages with same sql instance?
my case is very simple:
I want write a stored procedure to send a xml to another database. The stored procedure is called by tables triggers when some data is changed under the specific conditions.
View 1 Replies
View Related
Jun 22, 2007
Where can I find Northwind OleDb Native Sample Application?
KB 909751 states to install VS 2005 with: "Smart Device Programmability install option"
When installing VS 2005 I do not get the opportunity to specify this option..
What am I missing?
Thanks in Advance..
JEK
View 3 Replies
View Related
Jul 11, 2006
After much work and thanks to all of you who helped on this here is a code sample that can be adapted. From the dataflow task add an OLEDB source component, a row count component and finally a Script Destination Component.
On the Script Destination Component rename the Input node of the imports and outputs tree view to "ParsedInput"
The readonly User: variables that start with gs can be read in the PreExecute method
The readwrite User: variable giSuccessCount can only be used in the post execute task because it is populated by the Row Count Component which is the previous object in the Dataflow
The xml code is adapted from an idea in Donald Farmers book
enjoy
Dave
Now if someone can make a Script Source Component that can read a file with a header , data body and trailer that would b egreat!
' Microsoft SQL Server Integration Services user script component
' This is your new script component in Microsoft Visual Basic .NET
' ScriptMain is the entrypoint class for script components
Imports System
Imports System.Data
Imports System.Math
Imports System.IO
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.Xml
Public Class ScriptMain
Inherits UserComponent
Dim sw As StreamWriter
'In addition to using the Imports System.Xml statement a reference must be added to the
'System.Xml assembly (Select Project-Add Reference from IDE)
Dim xWriter As XmlTextWriter
Dim OutputFileType As String '.csv or .xml
Public Overrides Sub PreExecute()
'Read Only variables
Dim gsPickUp As String = Me.Variables.gsPickUp 'D:ftprootOutAvid'
Dim gsPickUpFilename As String = Me.Variables.gsPickUpFilename '1_AVID_'
Dim gsPickUpFileExtn As String = Me.Variables.gsPickUpFileExtn '.csv'
Dim gsMemoText As String = Me.Variables.gsMemoText 'Memo Text : credit adjustment'
Dim gsStatementText As String = Me.Variables.gsStatementText 'Statment Text : credit adjustment'
Dim gsRunMode As String = Me.Variables.gsRunMode 'UPDATE'
Dim fileName As String = gsPickUp & "" & gsPickUpFilename
fileName = fileName & (Format(Now(), "yyMMdd").ToString)
'MsgBox(fileName)
OutputFileType = gsPickUpFileExtn
If OutputFileType = ".csv" Then
fileName = fileName & gsPickUpFileExtn
sw = New StreamWriter(fileName) 'connection to dest file
'Header records
sw.Write(gsRunMode)
sw.Write(Environment.NewLine) ' end of line
sw.Write(gsMemoText)
sw.Write(Environment.NewLine)
sw.Write(gsStatementText)
sw.Write(Environment.NewLine)
sw.Write(Environment.NewLine) 'Spacer
End If
If OutputFileType = ".xml" Then
fileName = fileName & gsPickUpFileExtn
'xWriter = New XmlTextWriter(Me.Connections.XMLConnection.ConnectionString, Nothing)
'xWriter.WriteStartDocument()
'xWriter.WriteComment("Customer file parsed using script")
'xWriter.WriteStartElement("x", "customer", "http://some.org/name")
'xWriter.WriteAttributeString("FileName", Me.Connections.XMLConnection.ConnectionString)
xWriter = New XmlTextWriter(fileName, Nothing)
xWriter.WriteStartDocument()
xWriter.WriteComment("Customer file parsed using script")
xWriter.WriteStartElement("x", "customer", "http://some.org/name")
xWriter.WriteAttributeString("FileName", fileName)
End If
End Sub
Public Overrides Sub ParsedInput_ProcessInputRow(ByVal Row As ParsedInputBuffer)
If OutputFileType = ".csv" Then
Dim delim As String = ","
sw.Write(Row.ProjectID.ToString + delim)
sw.Write(Row.TransactionRefNum.ToString + delim)
sw.Write(Row.CustomerNum.ToString + delim)
sw.Write(Row.AccountNum.ToString + delim)
sw.Write(Environment.NewLine) ' end of line
sw.Flush() 'send the stream to file
End If
If OutputFileType = ".xml" Then
xWriter.WriteStartElement("CUSTOMER")
xWriter.WriteStartElement("ProjectID")
xWriter.WriteString(Row.ProjectID.ToString)
xWriter.WriteEndElement()
xWriter.WriteStartElement("TransactionRefNum")
xWriter.WriteString(Row.TransactionRefNum.ToString)
xWriter.WriteEndElement()
xWriter.WriteStartElement("CustomerNum")
xWriter.WriteString(Row.CustomerNum.ToString)
xWriter.WriteEndElement()
xWriter.WriteStartElement("AccountNum")
xWriter.WriteString(Row.AccountNum.ToString)
xWriter.WriteEndElement()
End If
End Sub
Public Overrides Sub PostExecute()
If OutputFileType = ".csv" Then
'Create the trailer
sw.Write(Environment.NewLine) ' blank line
sw.Write("RECORD_COUNT: " & Me.Variables.giSuccessCount.ToString) 'ReadWrite Varible
sw.Write(Environment.NewLine)
sw.Flush() 'send the stream to file
'Close file
sw.Close()
End If
If OutputFileType = ".xml" Then
xWriter.WriteStartElement("RecordCount")
xWriter.WriteString(Me.Variables.giSuccessCount.ToString)
xWriter.WriteEndElement()
xWriter.WriteEndElement()
xWriter.WriteEndDocument()
xWriter.Close()
End If
End Sub
End Class
View 6 Replies
View Related
Nov 22, 2006
Hi,
Does anybody have a working Java code sample that connects to an SQLServer 2005 database on a remote host, via the default named pipe, from a client using the SQLServer 2005 JDBC driver? Could you post it, or a pointer to it?
I've gotten java.sql DriverManager.getConnection() to work fine with TCP/IP connections before. But I'm a newbie with named pipes, and unclear on how the connection string/properties are different. I've tried to piece it together from multiple docs and threads, but haven't found sample code that quite fits my situation. I think a simple working example would best clarify the syntax.
The server is not using SQL Express. Most SQLServer configuration options are defaults; the named pipes protocol is enabled.
Thanks
View 3 Replies
View Related
Jul 27, 2006
Hi all--I'm trying to convert a function which I inherited from a SQL Server 2000 DTS package to something usable in an SSIS package in SQL Server 2005. Given the original code here:
Function Main()
on error resume next
dim cn, i, rs, sSQL
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=sqloledb;Server=<server_name>;Database=<db_name>;User ID=<sysadmin_user>;Password=<password>"
set rs = CreateObject("ADODB.Recordset")
set rs = DTSGlobalVariables("SQLstring").value
for i = 1 to rs.RecordCount
sSQL = rs.Fields(0).value
cn.Execute sSQL, , 128 'adExecuteNoRecords option for faster execution
rs.MoveNext
Next
Main = DTSTaskExecResult_Success
End Function
This code was originally programmed in the SQL Server ActiveX Task type in a DTS package designed to take an open-ended number of SQL statements generated by another task as input, then execute each SQL statement sequentially. Upon this code's success, move on to the next step. (Of course, there was no additional documentation with this code. :-)
Based on other postings, I attempted to push this code into a Visual Studio BI 2005 Script Task with the following change:
public Sub Main()
...
Dts.TaskResult = Dts.Results.Success
End Class
I get the following error when I attempt to compile this:
Error 30209: Option Strict On requires all variable declarations to have an 'As' clause.
I am new to Visual Basic, so I'm on a learning curve here. From what I know of this script:
- The variables here violate the new Option Strict On requirement in VS 2005 to declare what type of object your variable is supposed to use.
- I need to explicitly declare each object, unless I turn off the Option Strict On (which didn't seem recommended, based on what I read).
Given this statement:
dim cn, i, rs, sSQL
I'm looking at "i" as type Integer; rs and sSQL are open-ended arrays, but can't quite figure out how to read the code here:
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=sqloledb;Server=<server_name>;Database=<db_name>;User ID=<sysadmin_user>;Password=<password>"
set rs = CreateObject("ADODB.Recordset")
This code seems to create an instance of a COM component, then pass provider information and create the recordset being passed in by the previous task, but am not sure whether this syntax is correct for VS 2005 or what data type declaration to make here. Any ideas/help on how to rewrite this code would be greatly appreciated!
View 7 Replies
View Related
Aug 18, 2004
Hi I really need your help and really there simple questions but i cabt get the answers.
Ive made a database in Microsoft SQL Server 2000 for a car dealer and I need help.
The first is that I need a select statement to find the most common model of car. I have a table named car and one of the field is called model. I need the code to find the most common model of car?? any ideas
Select (something dont know wat) model
From Car
Any Ideas
View 1 Replies
View Related
Dec 8, 2003
Can someone please help me fix this. The if statement always runs. I only want it to run if the statement is true and there is a result coming back. If the productID does not have any magazines linking to it, I don't want the If statement to run. Thanks in advance.
ASP.NET code:
If Not Magazine.GetMagazinesForProduct(ProductID) Is Nothing Then
blanklabel.Text = categoryDetails.Spacer
blanklabel.Visible = True
blanklabel2.Text = categoryDetails.Spacer
blanklabel2.Visible = True
magazinerecommendedlabel.Text = "Recommended/Featured in the following magazine(s):"
magazinerecommendedlabel.Visible = True
End If
-------------------------
magazine class:
Public Function GetMagazinesForProduct(ByVal productID As String) As SqlDataReader
Dim connection As New SqlConnection(connectionString)
Dim command As New SqlCommand("GetMagazinesForProduct", connection)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add("@ProductID", SqlDbType.VarChar, 50)
command.Parameters("@ProductID").Value = productID
connection.Open()
Return command.ExecuteReader(CommandBehavior.CloseConnection)
End Function
-----------------------
Stored Procedure:
CREATE PROCEDURE GetMagazinesForProduct
(@ProductID varchar)
AS
SELECT Magazine.[Name], Magazine.[Issue], Magazine.SmallImagePath
FROM Magazine INNER JOIN MagazineProduct
ON Magazine.MagazineID = MagazineProduct.MagazineID
WHERE MagazineProduct.ProductID = @ProductID
RETURN
GO
--------------------------
View 3 Replies
View Related
Aug 19, 2004
Hi,
i transferred some data from a table to a txt file in DTS (Using some sort of SQT Tasks for updates and deletes.) Before i send it to another computer using FTP, i want to convert the txt file to cvs. Can you please tell me what code i can use?
Thanks.
View 1 Replies
View Related
Mar 7, 2005
Hi,
I have a table with a "description" row.
In this row I may have some simple quote (') character.
How can I select them ?
something like :
select * from myTable where description like %'%
thanks
View 3 Replies
View Related
Mar 15, 2007
Help. Several people have told me to connect to SSIS from SSMS, but I don't know how. Can someone PLEASE tell me how to connect to SQL Server Integration Services from Management Studio?
Thank you
View 2 Replies
View Related
Feb 29, 2008
Im trying to use VB.net 2005 to write a sample app to access a DB. Are there any samples for this and any samples of how I go about making the DB in the first place?
View 1 Replies
View Related
Feb 22, 2008
Replace the <<job name>> with the actual job name
---Last n RUN status of the job------
SELECT TOP 20
SJ.name 'JOB Name'
,'Run date : ' +
REPLACE(CONVERT(varchar,convert(datetime,convert(varchar,run_date)),102),'.','-')+' '+
SUBSTRING(RIGHT('000000'+CONVERT(varchar,run_time),6),1,2)+':'+SUBSTRING(RIGHT('000000'+CONVERT(varchar,run_time),6),3,2)+':'+SUBSTRING(RIGHT('000000'+CONVERT(varchar,run_time),6),5,2) 'Start Date Time'
,SUBSTRING(RIGHT('000000'+CONVERT(varchar,run_duration),6),1,2)+':'+SUBSTRING(RIGHT('000000'+CONVERT(varchar,run_duration),6),3,2)+':'+SUBSTRING(RIGHT('000000'+CONVERT(varchar,run_duration),6),5,2) 'Duration'
,CASE run_status WHEN 1 THEN '1-SUCCESS' WHEN 0 THEN '0-FAILED' ELSE CONVERT(varchar,run_status) END AS 'Status'
,Step_id
,[Message]
,[Server]
FROM MSDB..SysJobHistory SJH
RIGHT JOIN MSDB..SysJobs SJ
ON SJ.Job_Id = SJH.job_id
WHERE SJ.name LIKE '%<<job name>>%'
AND Step_ID = 0 --Comments this line if you want to see the status of each step of the job
ORDER BY run_date DESC, run_time DESC, step_ID DESC
---Last n RUN status of the job---------
View 7 Replies
View Related
Jan 5, 2007
hi,
when i tried to run the following code , the code keeps on running without creating the required table...............
pls can anyone help me to figure out the problem........
waiting for your replies...
int row_head = 3;
int col_head = 3;
TextBox[] columns1=new TextBox[5];
TextBox[] rows = new TextBox[2];
for (int i = 0; i < 3; i++)
columns1[ i ] = new TextBox();
for (int i = 0; i < 2; i++)
rows[ i ] = new TextBox();
columns1[0].Text = "col1";
columns1[1].Text = "col2";
columns1[2].Text = "col3";
rows[0].Text = "rowh1";
rows[1].Text = "rowh2";
String[] description=new string[10];
for (int k = 0; k < 10; k++)
description[k] = k.ToString();
int index_value = 0;
int des_index = 0;
string datatype = "";
string command = "";
SqlConnection sqlCN = new SqlConnection(connectionString);
for (int i = 0; i < col_head + 1; i++)
{
if (i == 0)
datatype += "(col " + i + " varchar(20),";
else if (i + 1 == col_head+1)
datatype += "col" + i + " varchar(20))";
else
datatype += "col" + i + " varchar(20),";
}
MessageBox.Show(datatype);
MessageBox.Show("create table " + textBox1.Text + " " + datatype);
string selectCommandText = "create table " + textBox1.Text +datatype;
MessageBox.Show("executed");
try
{
SqlCommand sqlCmd = new SqlCommand(selectCommandText, sqlCN);
sqlCN.Open();
MessageBox.Show("open ");
// the following command is not executed.....
sqlCmd.ExecuteNonQuery();
MessageBox.Show("open and execu");
for (int i = 0; i < row_head + 1; i++)
{
command="";
if (i == 0)
{
command="' ',";
for(int j=0;j<col_head;j++)
{
if(j+1==col_head)
command+="'"+columns1[j].Text+"'";
else
command+="'"+columns1[j].Text+"',";
}
}
else
{
command = "'"+rows[index_value++].Text+"',";
for (int j = des_index; j < des_index + col_head; j++)
{
if (j +1== des_index+col_head)
command += "'" + description[j] + "'";
else
command += "'" + description[j] + "',";
}
des_index = des_index + col_head;
}
MessageBox.Show("INSERT INTO " + textBox1.Text + " values(" + command + ")");
sqlCmd.CommandText = "INSERT INTO " + textBox1.Text + " values("+command+")";
sqlCmd.ExecuteNonQuery();
}
MessageBox.Show("fini");
selectCommandText = "SELECT * FROM " + textBox1.Text;
sqlCmd = new SqlCommand(selectCommandText, sqlCN);
sqlCmd.ExecuteNonQuery();
SqlDataAdapter sqlDA = new SqlDataAdapter(selectCommandText, sqlCN);
DataSet DS = new DataSet();
sqlDA.Fill(DS);
MessageBox.Show("fini 2");
DataGridView1.DataSource = DS.Tables[0].DefaultView;
}
catch (Exception eio)
{ }}
Sweety
View 6 Replies
View Related
Jul 21, 2000
Hi!
How one can find out the character set/code page set during SQLServer installation?
Thanks,
Fabio
View 1 Replies
View Related
Sep 17, 1998
Hi,
Does anybody know where to find out the definition of all the SQL error code
For example, What does error code 4002 means ? What does error code 3146 means ? Thanks.
View 2 Replies
View Related
Feb 12, 2015
I have a table with code and description as below
create table isin_code
(
code varchar(5),
code_desc varchar(255)
)
go
insert into isin_code values ('aaa','aäsas')
go
insert into isin_code values ('aaa','as╚as')
go
insert into isin_code values ('aaa','aâsas')
go
insert into isin_code values ('aaa','asas')
go
I want to identify the list of alt codes available in the table.
View 6 Replies
View Related
Mar 24, 2008
We have a sql job type SSIS package that is not populating a database table as expected and I'm trying to figure what why not but I'm not sure where the "code" is. The person that created it said they copied a legacy package (sql 2000) and made modifications to it, then migrated it to the new version. When a legacy package is migrated is there a SSIS solution built? I see you can edit SSIS packages only in BI Development Studio but I'm not sure where to find package.
This post may answer my question but if you have any additional or updated information I'd like to hear it.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=393634&SiteID=1
So, to view or edit the package you have to export it?
Package location
Select the type of storage location to export the package to. The following options are available:
SQL Server
File System
SSIS Package Storage
So do you pick "File System" in order to view it in BI?
Thanks for your help.
View 6 Replies
View Related