Skip to content

Database

Discussions on database access, SQL, and ADO

This category can be followed from the open social web via the handle database@forum.codeproject.com

17.1k Topics 61.8k Posts
  • SQL: Split calendar week between a given two date time

    database com
    8
    0 Votes
    8 Posts
    0 Views
    N
    Hello Richard Deeming, yeah then i will check on that. And thanks for your valuable time and suggestions.
  • 0 Votes
    7 Posts
    0 Views
    Z
    You can add a timestamp or guid column to mark them. Essentially, you need to have your own logic. There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.
  • Access ComboBox Query Question

    database help question html com
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    2 Posts
    3 Views
    M
    looks like the network connection isn't ok - I would first check if the connection to the server is ok by using tnsping: https://docs.oracle.com/cd/E11882_01/network.112/e41945/connect.htm#NETAG357 or try to connect with orcale sql developper
  • Basic Entity Framework Question

    wpf question csharp database architecture
    2
    0 Votes
    2 Posts
    0 Views
    M
    I use Viewmodels for implementing INotifyPropertyChanged and a Converter which copies members of datalayer EF Model Classes to Viewmodel Classes. Example for viewmodel base class: https://stackoverflow.com/questions/36149863/how-to-write-viewmodelbase-in-mvvm-wpf
  • ORDER BY issue with Interbase XE SQL Server

    database question css sql-server sysadmin
    4
    0 Votes
    4 Posts
    0 Views
    L
    0x01AA wrote: Using a temp table, then it takes nearly 0 seconds, but temp table with Interbase is very uncomfortable compared to MSSQL. Wrap it in a transaction. Without committing, there is no temp table; should isolate the operation. Would work best as a stored procedure :) You're welcome ofc :) Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Loading Data on Demand

    database csharp sql-server sysadmin question
    12
    0 Votes
    12 Posts
    0 Views
    Richard Andrew x64R
    Thank you, this looks very promising. :) The difficult we do right away... ...the impossible takes slightly longer.
  • single DataSet having multiple DataTables from multiple databases

    question
    6
    0 Votes
    6 Posts
    0 Views
    L
    MARS be slow, but selecting from a different DB is hardly noticable on SQL Server. Also doesn't need much mucking with datasets, just plain SQL. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • 0 Votes
    11 Posts
    0 Views
    K
    ok. Tks. Mycroft Holmes. However, how do I insert into the third table? Should I use select subj_Id from subject and select tutor_id and then insert into the 3rd table ?
  • 0 Votes
    2 Posts
    0 Views
    Kornfeld Eliyahu PeterK
    You do not explain what kind of data it is and what search you want to do... As for the HASH based search - it will work only if you search for exact data, for instance 'Gilbert Consellado' will produce a constant HASH but the HASH for 'Gilbert' will not be part of it, so you will find that piece of data only if you are looking for 'Gilbert Consellado' exactly as is (include case and space and order)... If there is a way to index the data, prior encryption, than you can use it (the HASH of the indexes) to search quickly at the DB level... Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
  • 0 Votes
    2 Posts
    0 Views
    L
    w14243 wrote: How to get original database information from backup file 'D:\SQLBK\Mon\dbc.bak' through SMO? e.g. database name. The database-name is not part of the backup. You backup the data, not meta-data on the file. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • 0 Votes
    2 Posts
    0 Views
    Richard DeemingR
    A "bad image format" exception usually points to trying to load 64-bit libraries in a 32-bit AppDomain, or vice-versa. You'll need to check whether your package is running as 32-bit or 64-bit, and make sure you're loading the correct version of the Oracle libraries. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • why we use datareader

    3
    0 Votes
    3 Posts
    0 Views
    M
    I think he just wanted to say hello... Never underestimate the power of human stupidity RAH
  • How to create SQL Server backup folder

    database sql-server sysadmin tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • 0 Votes
    11 Posts
    1 Views
    Richard DeemingR
    1. Yes. 2. Lots of indexes will potentially decrease the performance of inserts and updates, but no more so that any other method of enforcing your requirements, and with less chance of making a mistake. A table with 30 columns might be a candidate for further normalization. But you would need to examine the data to determine that, and test what effect that might have on the performance and complexity of your queries. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • SSRS - dynamic columns depending on client parameter

    sql-server tutorial question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • SQL for dynamic mappings

    database sql-server help tutorial question
    8
    0 Votes
    8 Posts
    0 Views
    D
    I achieved this in the end by dynamically creating strings to pass in to a SQL statement I was building up. I used MAX and Case statements to achieve this. I finished it an EXEC (@MyString). Thanks for the advice!
  • Display data only from search parameters

    css database security
    4
    0 Votes
    4 Posts
    0 Views
    CHill60C
    Here is an example using a ComboBox and a TextBox. I've used a ComboBox with fixed entries for the user to choose from. I don't want them to enter the column name for a few reasons: They might misspell it, they might introduce other errors and because I'm using string concatenation to get the column name (only the name, NOT the value) it provides a further protection against SQL Injection. private void button1\_Click(object sender, EventArgs e) { if (cmbColumns.SelectedIndex == -1) { MessageBox.Show("You must select a column"); return; } if (string.IsNullOrEmpty(tbSearch.Text)) { MessageBox.Show("You must enter a value to search for"); return; } // This bit would NOT normally be within the UI layer var conString = ConfigurationManager.ConnectionStrings\["ConnectToDB"\].ConnectionString; using (SqlConnection conn = new SqlConnection(conString)) { conn.Open(); using (var myCommand = new SqlCommand()) { myCommand.Connection = conn; var sb = new StringBuilder( "SELECT First\_Name, Last\_Name, Grid\_Square, Country, State, Call\_Sign, Date\_Time, Mode, Power "); sb.Append("FROM clouddata WHERE "); sb.Append(cmbColumns.SelectedItem); sb.Append("=@searchValue"); myCommand.CommandText = sb.ToString(); myCommand.Parameters.AddWithValue("@searchValue", tbSearch.Text); using (var adapter = new SqlDataAdapter(myCommand)) { var myTable = new DataTable(); adapter.Fill(myTable); dataGridView1.DataSource = myTable; } } } }
  • Team Please help on the below request

    sql-server collaboration help
    2
    0 Votes
    2 Posts
    0 Views
    M
    You can't work out that you need to create an expression in a new field that calculates the difference? Give it up and look for another career. Never underestimate the power of human stupidity RAH