Knowledge Base Category: Development

How to find a String in a Store Procedure?

The following code finds a string thru all store procedures
[tp no_translate="y"]
select p.name from sys.procedures p join 
syscomments c ON c.id=p.object_id
where text like '%TABLENAME%'
To search for a column name in a table use the following:
 Select t.name as tablename,c.* from sys.columns c 
 Join sys.tables t on c.object_id=t.object_id
 where c.name = 'Note'
[/tp]  ...
Read more

How to get records from SQL to a label, textbox, or a datatable?

Make sure you import: [tp no_translate="y"]
Imports System.Data
Imports System.Data.SqlClient
For C#:
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
[/tp]
to get one record FROM PROCEDURE
[expand title="see code"] [tp no_translate="y"]
Public Function gettotal(ByVal VARIABLE As Int32) As Decimal
        Dim Total... 						
						
Read more

How to upload a file, save its Filename

Create a form, add a button upload and a fileupload add a datasource with insert script. Code Behind: [tp no_translate="y"]
Protected Sub Buttonupload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Buttonupload.Click
Dim str As String

str = FileUploadcontrol.FileName.ToString()
FileUploadcontrol.SaveAs("FolderLocation" & str.ToString)

 

SqlDataSourcecontrol.InsertParameters("Categoryid").DefaultValue = DropDownListcategory.SelectedValue
SqlDataSourcecontrol.InsertParameters("Question").DefaultValue = TextBox1.Text
SqlDataSourcecontrol.InsertParameters("filename").DefaultValue = str.ToString
SqlDataSourcecontrol.Insert()
TextBoxQuestion.Text = ""
End Sub

[/tp]...
Read more
Page 10 of 12« First...89101112